A Match function JavaScript

by Mohan 2012-09-20 23:03:44



A Match function
JavaScript 1.8
function Match(v) Array.indexOf(arguments,v,1)-1;
usage:
Print( Match('aa', '0', 'b', 123, 'aa', 8.999 ) ); // prints: 3
Print( Match('Z', 'b', 123, 'aa', 8.999 ) ); // prints: -2 (< 0 is not found)




matc
811
like
0
dislike
0
mail
flag

You must LOGIN to add comments