Skip to content

Instantly share code, notes, and snippets.

@robertoandres24
Last active June 18, 2020 05:00
Show Gist options
  • Save robertoandres24/fd0d46dd0be75b88107ca5e3ef2c62c8 to your computer and use it in GitHub Desktop.
Save robertoandres24/fd0d46dd0be75b88107ca5e3ef2c62c8 to your computer and use it in GitHub Desktop.
let data = {
"name": "Servipag Escuela Agricola",
"online": false,
"location": {
"region_id": 13,
"region": "Metropolitana de Santiago",
"office": "servipag-escuela-agricola",
"district": "Macul",
"country": "Chile",
"city": "Santiago"
},
"category": "servipag",
"lines": {
"servipag-escuela-agricola-cheque-deposito": {
"waiting": 8,
"name": "Cheque Depósito",
"elapsed": 245.76666666666668
},
"servipag-escuela-agricola-atencion-general": {
"waiting": 21,
"wait": 197,
"name": "Atención General",
"elapsed": 341.53164556962014
}
}
}
Object.entries(data.lines).forEach(([key, val]) => {
console.log(key); // the name of the current key.
console.log(val); // the value of the current key, in this case an object
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment