I have an object:
location = {place1: distance1, place2:distance2};
How do I set something like location.name = location, so that I can access the "location" string later on?
Would something like this work?
location = {
place1: distance1,
place2: distance2
location.name = "location";
}
Thanks in advance!
window.locationhas meaning! You need to pick a different variable name if it is a global variablelocationinside the object?