Hello,
I want to creat array/s in javascripts.
But array/s numbers (how many to arrays to be created) is depend on dropdown div length.
I have calculated length of dropdown list using
$("#skill_type_name option").length)

But how to create arrays in javascripts in foor loop.
array names can be
array1[]
array2[]
array3[]
array4[]
...

or names will be given according to dropdown div values.
But how to creat arrays?

Member Avatar
var arr = ["a","b","c"];

Or you can create an object containing arrays...

var obj = {"arr1":["a","b","c"],"arr2":["x","y","z"]};

However there are no associative arrays in js, if you need 'string keys' then use objects.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.