index of item in array
morteza_karimi
Member Posts: 13 ✭
Is there something similar to indexOf() method of javascript that returns the index of a given item in an array?
Tagged:
0
Comments
-
you can look at source code of isIn() builtin function of standard library and modify it to return the index instead of boolean2
-
Here is an example function:
function indexOf(value, arr is array) returns number { for(var i = 0; i < size(arr); i += 1) if(value == arr[i]) return i; return -1; }
2

