Hey, I am searching each array separately for specific inputs from a user.
if ($.inArray(i.val(), helloInputArray) > -1) { //IF HELLO
if (hello == 0) { //HAVE YOU ALREADY SAID HI?
r = Math.floor(Math.random()*4);
o.html(o.html()+helloOutputArray[r]);
hello = 1;
i.val('');
} else { //IF YOU'VE ALREADY SAID HI...
o.html(o.html()+'I already said hi to you!<br />');
i.val('');
}
} else if ($.inArray(i.val(), byeInputArray) > -1) { //IF GOODBYE
if (bye == 0) {
r = Math.floor(Math.random()*4);
o.html(o.html()+byeOutputArray[r]);
i.val('');
} else {
o.html(o.html()+'I already said goodbye... Go away!');
i.val('');
}
}
Is there any way I can just search all arrays at once, as I'm going to need to search each array for a string.
ahem
so - If I typed 'ae', then I want it to go through every item in every array and return ALL the strings with 'ae' in it.
^_^ <( bad wording... )