Here is the code snippet I am working with:
d3.csv("static/data/river.csv", function(data) {
var latlongs = data.map(function(d) { return [d.Lat,d.Lng]; })
var lineArray1 = latlongs;
console.log(lineArray1);
When I view the output lineArray1, it appears as [Array(2), Array(2), Array(2)...]. However, upon closer inspection, the individual Array(2) elements look like:
["-35.48642101", "144.8891555"]
["-35.48695061", "144.8893026"]
["-35.48704283", "144.889315"]
I am looking for a way to remove the double quotes at the start. I attempted lineArray1.map(Number) but this resulted in an array of NaNs. The desired output format is:
[-35.48642101, 144.8891555]
[-35.48695061, 144.8893026]
[-35.48704283, 144.889315]
Any suggestions would be greatly appreciated!