I created an object called Location:
function Location(street,city,postal,phone,fax, lat, lon, distance){
this.street = street;
this.city = city;
this.postal = postal;
this.phone = phone;
this.fax = fax;
this.lat = lat;
this.lon = lon;
this.distance = distance;
}
Then constructed each of the objects:
example1 = new Locaiton('value', 'value', etc)
example2 etc etc
Then stored the objects in an array
var cities = [example1, example2]
I tried using cities[0].constructor.name, but this just prints out Location.
How do I print out "example1" so that I can compare it with a matching element id in an if statement?