jquery - Creating array collection in JavaScript? -


Is it possible to create array archive in JavaScript? If so, how can I do this? If I have some data: for example 1- 5.

You can create an object:

  var obj = {my1 : 'Data', my2: 'other'};   

or

  var array = ['data', 'other'];   

You can access all data

 for  (var key in the array) {item = array [key]; } (Var key in obj) {item = obj [key]; }    

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -