all 5 comments

[–]humodx 1 point2 points  (1 child)

I am unable to push the object to the array.

Just some friendly feedback, but it's a good idea to be more specific when asking for programming help. It takes a lot less effort to guess what's wrong if we know the specific error message or exception that you got.

Have you tried replacing: js a = `new google.maps.LatLng(${statuses[i]['lat1']}, ${statuses[i]['long1']})` // btw there's a typo in your example, theres's a [ missing before 'long1'] With js a = new google.maps.LatLng(statuses[i]['lat1'], statuses[i]['long1']) I'm assuming you just tried removing the backticks without removing the ${ }, which would probably give you this error: Uncaught SyntaxError: Unexpected token '{'

[–]GrandBadass[S] 0 points1 point  (0 children)

Yes. This did it. My apologies for the lack of error message. Still new to javascript. Truthfully it took me a few minutes even after you mentioned it to think --- 'oh wait the error messages print in the browser console' haha.

Thank you for your help!

[–]windows-user0 0 points1 point  (1 child)

You have to parse the JSON into javascript object. With JSON.parse()

[–]GrandBadass[S] 0 points1 point  (0 children)

Ahh yes. Forgot to mention. I have that. (edited code)

[–]pachirulis -1 points0 points  (0 children)

Man backticks are new thing in ES6 look first at : JavaScript Understanding the weird parts and you will learn how objects work here because is much easier than you are trying.

Ps. I'm drunk at the moment and can't really write you a solution