Guest User

Untitled

a guest
Jul 4th, 2012
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. How to get the index of an object inside an array of objects?
  2. box[0] = {...}
  3. box[1] = {...}
  4. box[2] = {...}
  5. ...
  6. box[499] = {...}
  7.  
  8. box[i].id = i;
  9.  
  10. theArr.indexOf( this ); // assuming the function was called from the context
  11. // of the object in question
Advertisement
Add Comment
Please, Sign In to add comment