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 blood = {
  "blood": {
    "one": {
      "iron": "Iron",
      "tibc": "TIBC",
    },
    "two": {
      "cd": "Carbon Dioxide",
      "sodium": "Sodium",
      "potassium": "Potassium",
      "chloride": "Chloride",
    },
    "three": {
      "cholesterol": "Cholesterol",
      "dhdl": "Direct HDL",
    },
    "four": {
      "rigg": "Rubella IgG",
      "hbsag": "HBsAg",
      "ahiv": "Anti-HIV 1+2",
      "estrdiol": "Estradiol",
      "fsh": "FSH",
    }
  }
}
let allTypes = [];
Object.values(blood.blood).forEach(v => {
  // we are iterating over "one"..."four"
  allTypes.push(...Object.values(v));
});
console.log(allTypes);
Output

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

Dismiss x
public
Bin info
kyle-mccarthypro
0viewers