I have an array that looks like this
$scope.A = [
[ "1.31069258855609,103.848649478524", "1.31138534529796,103.848923050526" ],
[ "1.31213221536436,103.848328363879", "1.31288473199114,103.849575392632" ]
];
I want to make it into something like this
$scope.B = [
[
[1.31069258855609,103.848649478524], [1.31138534529796,103.848923050526]
],
[
[1.31213221536436,103.848328363879], [1.31288473199114,103.849575392632]
]
];
PS: Sorry if this isnt splitting, I am not sure how to address this problem as
Code:
var latlngs = $scope.polyLineCord.map(subarr => subarr.map(str => str.split(',').map(Number)))
console.log(latlngs)
