Skip to content

Instantly share code, notes, and snippets.

@Bijesse
Forked from anonymous/index.html
Created April 19, 2016 15:16
Show Gist options
  • Select an option

  • Save Bijesse/8a9298ab9518cb7550722e86ecbbed24 to your computer and use it in GitHub Desktop.

Select an option

Save Bijesse/8a9298ab9518cb7550722e86ecbbed24 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/kohazi
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var hero =
spiderman: {
codename:"Spiderman",
identity:"Peter Parker",
power:"strength, spidey sense, wall-crawling",
isHero:true
}
};
// delete hero.isHero;
// console.log(hero.isHero);
hero.spiderman.codename = "Spider-Man";
/*
hero.nemesis = "Venom";
for (var key in hero){
console.log(hero[key]);
}
// console.log(hero.nemesis);
*/
/*
How do I print out the hero's identity?
How do I change the hero's codename?
How do I add another property?
How do I remove isHero?
How do I print each value in our object without having to access each one individually?
How would I store more than one hero? (Objects within objects!)
*/
</script>
<script id="jsbin-source-javascript" type="text/javascript">var hero =
spiderman: {
codename:"Spiderman",
identity:"Peter Parker",
power:"strength, spidey sense, wall-crawling",
isHero:true
}
};
// delete hero.isHero;
// console.log(hero.isHero);
hero.spiderman.codename = "Spider-Man";
/*
hero.nemesis = "Venom";
for (var key in hero){
console.log(hero[key]);
}
// console.log(hero.nemesis);
*/
/*
How do I print out the hero's identity?
How do I change the hero's codename?
How do I add another property?
How do I remove isHero?
How do I print each value in our object without having to access each one individually?
How would I store more than one hero? (Objects within objects!)
*/</script></body>
</html>
var hero =
spiderman: {
codename:"Spiderman",
identity:"Peter Parker",
power:"strength, spidey sense, wall-crawling",
isHero:true
}
};
// delete hero.isHero;
// console.log(hero.isHero);
hero.spiderman.codename = "Spider-Man";
/*
hero.nemesis = "Venom";
for (var key in hero){
console.log(hero[key]);
}
// console.log(hero.nemesis);
*/
/*
How do I print out the hero's identity?
How do I change the hero's codename?
How do I add another property?
How do I remove isHero?
How do I print each value in our object without having to access each one individually?
How would I store more than one hero? (Objects within objects!)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment