Source Code:
(back to article)
Submit
Result:
Report an issue
99
1
2
3
4
5
6
7
8
9
10
›
⌄
var array = [11, 20, 8, 6, 17];
var el = 6; //Element to be searched
for(var i=0; i<
array.length
; i++) {
if(el === array[i]) {
console.log('Element Found');
}
}
var array = [11, 20, 8, 6, 17]; var el = 6; //Element to be searched for(var i=0; i<array.length; i++) { if(el === array[i]) { console.log('Element Found'); } }