I have a sample code:
var find = ['iphone 3', 'iphone 4', 'iphone 5'];
var search = 'iphone 5';
for(i=0; i<find.length; i++) {
if(search == find[i]) {
alert('Yes');
} else {
alert('No');
}
}
When I run code, result 2 alert(alert('Yes') and alert('No')
), but result exactly is only a alert('Yes'),
how to fix it ?