Skip to content

Instantly share code, notes, and snippets.

@yogendratamang48
Created March 2, 2023 20:26
Show Gist options
  • Save yogendratamang48/c4fb0614b750fc43d7b2c6544655a4e0 to your computer and use it in GitHub Desktop.
Save yogendratamang48/c4fb0614b750fc43d7b2c6544655a4e0 to your computer and use it in GitHub Desktop.
Just a test

Working with json

Write a JavaScript program to do following

  1. Who is the oldest super hero ?
  2. Which Superheroes have the power Teleportation ?
  3. Show the table with each super hero name and the number of powers they have in a table.
{
"squadName": "Super hero squad",
"homeTown": "Metro City",
"formed": 2016,
"secretBase": "Super tower",
"active": true,
"members": [
{
"name": "Molecule Man",
"age": 29,
"secretIdentity": "Dan Jukes",
"powers": ["Radiation resistance", "Turning tiny", "Radiation blast"]
},
{
"name": "Madame Uppercut",
"age": 39,
"secretIdentity": "Jane Wilson",
"powers": [
"Million tonne punch",
"Damage resistance",
"Superhuman reflexes",
"Teleportation"
]
},
{
"name": "Eternal Flame",
"age": 1000000,
"secretIdentity": "Unknown",
"powers": [
"Immortality",
"Heat Immunity",
"Inferno",
"Teleportation",
"Interdimensional travel"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment