JSFiddle - React, Tailwind, and code Playground

by Alma Grace

JavaScript

newObject = {
 "first": "John",
 "last": "Doe",
 "age": 39,
 "sex": "M",
 "salary": 70000,
 "registered": true,
 "interests": [ "Reading", "Mountain Biking", "Hacking" ],
 "favorites": {
  "color": "Blue",
  "sport": "Soccer",
  "food": "Spaghetti"
 }, 
 "skills": [
  {
   "category": "PHP",
   "tests": [
    { "name": "One", "score": 90 },
    { "name": "Two", "score": 96 }
   ] 
  },
  {
   "category": "CouchDB",
   "tests": [
    { "name": "One", "score": 32 },
    { "name": "Two", "score": 84 }
   ] 
  },
  {
   "category": "Node.js",
   "tests": [
    { "name": "One", "score": 97 },
    { "name": "Two", "score": 93 }
   ] 
  }
 ]
}

alert( newObject.favorites.food );

alert( newObject["favorites"]["food"] );

alert( newObject.skills[1].tests[0].score );

alert( newObject["skills"][1]["tests"][0]["score"] );