I was just reading up on push. I have a few questions regarding jQuery arrays.
- How would I print/alert the contents of an array to check what is being pushed into them?
- How do I call a particular key in the array?
- Is there any decent documentation on jQuery arrays?
EDIT:
I’m not sure. I want to store a new variable in an array on a keyup event. So each time a user performs the event a position is stored as a new key in a variable. so later when another object enters that position a function is performed.
Arrays are the only way I can see this working?
To print (or do something) with each item in an array you can use jQuery’s
.each()and to check if something is in an array.inArray()As others have said there is no such thing as a “jQuery array”.
http://api.jquery.com/jQuery.each/
http://api.jquery.com/jQuery.inArray/