How to add number with variable name? [duplicate]

var varMap = {};
for(var i=1; i<10; i++) varMap['stop'+i] = 123;

I think this will help

Leave a Comment