Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
let json = 
  {
    "123":{
      "name":"someName",
      "age":"12",
      "health":{
        "heart":"OK",
        "lungs":"Not so good"
      }
    },
    "223": {
      "name":"someName1",
      "age":"42",
      "health":{
        "heart":"Not so good",
        "lungs":"OK"
      }
    }
  }
   
  
let l = Object.keys(json)
console.log(l.length)
for(let i = 0; i < l.length; i++){
  let element = json[l[i]];
  let modulo = i % 2 === 0 ? " modulo 0 " : " modulo 1 "
  console.log(`id=${i}, ${element.name}, ${modulo}, ${element.health.lungs}`);
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers