Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to get the index of an object inside an array of objects?
- box[0] = {...}
- box[1] = {...}
- box[2] = {...}
- ...
- box[499] = {...}
- box[i].id = i;
- theArr.indexOf( this ); // assuming the function was called from the context
- // of the object in question
Advertisement
Add Comment
Please, Sign In to add comment