Hi everyone,
Just wondering if someone could give me a hand quickly. I have this piece of code that I want to be able to search for names in an array and if it finds them then it matches them.
e.g. The code below would find 2 matches.
Hope someone can help. Thanks
Code:
name = [Simon, Jim,Mark,Ryan];
stored_names = [Jim,Simon,James,Simon,Tim];
var match_checker = 0;
for (var count_index = 0; count_index < name.length; count_index = count_index ++)
{
if (name[count_index] == stored_names)
{
match_checker = match_checker + 1;
}
document.write (match_checker); //display numb of matches
}
}
Last edited by timbrown2009; 03-27-2009 at 07:15 AM.
there are alot of things wrong with that mate tbh, cant really think right now, drink does that to ya but ill be on msn sometime tomorrow so gimme a shout then ok?
Bookmarks