var a =['hello', 'her'];
a[1] = a[1].toLowerCase();
a[0] = a[0].toLowerCase();
var l= a[1].length;
for (i=0;i<l;i++){
n= a[0].indexOf(a[1][0]);
if (n<0)
{break;
}
}
if (n!=-1){
console.log(true);
}
else {
console.log(false);
}
the outcome is true, instead of false. could someone show me where i am getting it wrong. thanks