0

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?

Edited by Priti_P

2
Contributors
1
Reply
10
Views
3 Years
Discussion Span
Last Post by diafol
0
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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.