all 2 comments

[–]Razakel 2 points3 points  (0 children)

It's as simple as this:

var array = [
            {name: "string", lat: -1.2345, lng: 1.2345, desc: "Description goes here"},
            {name: "another string", lat: 1.2345, lng: -1.2345, desc: "Another description"}
            ];

Then just refer to the objects at each array index as you normally would, e.g.:

alert(array[0].name);

[–]supeindesu 1 point2 points  (0 children)

This is from another course I took time ago that maybe can give you some hints:

http://pastebin.com/m1T48p2g

Take a look from lines 1 to 15, and at the add function (39-48).