title: Get object name in javascript
body: <p>I want to get the name of objects in another object.
  These are my objects:</p>
  
  <pre><code>{
  "events": {
  "EED8A79F-B374-4AE6-BA6F-B7B98D9D7142": {
    "name": "Defeat the renegade charr.",
    "level": 42,
    "map_id": 20,
    "flags": [],
    "location": {
      "type": "sphere",
      "center": [ -9463.6, -40310.2, -785.799 ],
      "radius": 2500,
      "rotation": 0
    }
  },
  "3A2B85C5-DE73-4402-BD84-8F53AA394A52": {
    "name": "Bonus Event: Cull the Flame Legion",
    "level": 80,
    "map_id": 929,
    "flags": [ "group_event" ],
    "location": {
      "type": "cylinder",
      "center": [ -38.7202, -176.915, -892.494 ],
      "height": 2027.5,
      "radius": 10314.4,
      "rotation": 0
    }
  },
  "CEA84FBF-2368-467C-92EA-7FA60D527C7B": {
    "name": "Find a way to open the door and escape the armory.",
    "level": 8,
    "map_id": 19,
    "flags": [ "group_event" ],
    "location": {
      "type": "poly",
      "center": [ -45685.2, -13819.6, -1113 ],
      "z_range": [ -2389, 163 ],
      "points": [
        [ -49395.8, -15845.5 ],
        [ -42699.7, -15794.1 ],
        [ -43053, -14081.4 ],
        [ -43629.7, -11725.4 ],
        [ -49647.8, -11651.7 ]
      ]
    }
  },
  ...
  }
  }
  </code></pre>
  
  <p>I use this piece of code to get all the objects in the "events" object and save them in localStorage:</p>
  
  <pre><code>$.each(data.events, function(index, value) {
      localStorage.setItem("Event" + event_count, data.events);
      event_count++;
  });
  </code></pre>
  
  <p>But now my localStorage is like this:
  <img src="https://i.stack.imgur.com/ppjD1.png" alt="LocalStorage after using code above"></p>
  
  <p>How can I get the object names in stead of the whole object? I can get the level, map_id etc by using data.events.level, data.events.map_id but how can I get the object names, for example: "EED8A79F-B374-4AE6-BA6F-B7B98D9D7142"</p>
  
  <p>Thanks in advance:)</p>