JoeBo747
asked on
Dynamic Array
I want to build the var struc dynamically using iteration something like what I have out lined below but properly:
var struc{};
for (var i = 0 ; i < 100 ; i++){
struc = struc + "'" + i + "'" + : + "'" + i + "'
}
The result should be like:
var struc = {'1':'1',
'2':'2',
'3':'3',
'4':'4',
'5':'5',
'6':'6',
'7':'7'
};
var struc{};
for (var i = 0 ; i < 100 ; i++){
struc = struc + "'" + i + "'" + : + "'" + i + "'
}
The result should be like:
var struc = {'1':'1',
'2':'2',
'3':'3',
'4':'4',
'5':'5',
'6':'6',
'7':'7'
};
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks for the code I am new to jquery and that is exactly what I was looking for.
Regards,
joe