javascript - Trying to create a ton of variables and a for loop won't work -


so, working on javascript need create hundreds of variables going hold urls. make of them in loop, of variables local variables. there way make work or work arounds possibly use?

like @slaks said, create array variable outside of loop. push url variables array create them. ex:

var arr = []; for(var i=0; i<10; i++) {     var url = "www.something.com";     arr.push(url); } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -