Link to home
Create AccountLog in
Avatar of JoeBo747
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'
};
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of JoeBo747
JoeBo747

ASKER

Hi leakim971,

Thanks for the code I am new to jquery and that is exactly what I was looking for.

Regards,
joe