I need to create dynamic variable name in js inside for loop
var counter = 0;
for(i=0; i<location.length; i++) {
...
var "marker_" + counter = new google.maps.Marker({
But when i expected to have variables marker_0,marker_1,marker_2,… i had this error
Error: SyntaxError: missing variable name
Source Code:
var "marker_" + counter = new google.maps.Marker({
Use an array: