Retrieve Value Array [closed]

3

I have an array of strings. I'm trying to retrieve the location value, but I'm not getting it. Take a look at the code:

 var cord = ["-19.45738,-44.2416695"];
  
  for(var i = 0; i<cord.length; i++){
        var location = cord[i].split[","];
        var marker = new google.maps.Marker({
        position: new google.maps.LatLng(location[0], location[1]),
        map: map
    });
         
       
    }
    
asked by anonymous 24.11.2016 / 12:48

1 answer

7

What's wrong is split:

var location = cord[i].split(",");

split is a function, use parentheses.

    
24.11.2016 / 12:53