I have an array which contains lat and lng. When I want to see the just one of them on console it returns me undefined value. I can only see the output without index. How can I solve this?
var point=[lat,lng];
console.log(point);// output is 'lat','lng'
console.log(point[0]); //output should be 'lat' but it returns undefined
const x = point[0];
console.log(x);//undefined
const y = point[1]
console.log(y);//undefined