How to deploy array in jQuery and java script?
i need to explore in this topic? Can any one help me?
How to deploy array in jQuery and java script? i need to explore in
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As jQuery is JavaScript, creating an array is simply:
There is never a reason to use the
Arrayconstructor.Read more about arrays.
Because someone mentioned associative arrays:
Although they might look like arrays, they are not arrays (in a strict JavaScript sense). This kind of data structure is normally created using objects (here with object literal notation. Same thing: There is no reason to use the
Objectconstructor.):In JavaScript you can access object properties with either dot notation (
obj.foo) or array notation (obj['foo']). This is convenient but you should not make the mistake to confuse objects and arrays.Especially you should not mix it and attach properties to an array (like an other answer shows) if you don’t know how/why it works (in short: Nearly everything in JavaScript is an object, also arrays. That does not mean that you should use them as such.).
Read more about objects.