user manikk
manikk (2)

Index of an Array Element

Function for finding the index of an array element
965 downloads, 13261 views


Download (10.74 KB)

Comments

You need to login to post a comment.

user squadjot
squadjot 1 decade ago

Nice, heres s short version =)

function getIndexOf(d:Array, val:Number):Number{
for (i=0; i<=d.length-1; i++) if (d[i] == val) return i;
}