Last active
March 2, 2018 13:32
-
-
Save ShahinAhmed7/00c163c615231de4281e1b782a985aff to your computer and use it in GitHub Desktop.
ES6-object// source http://jsbin.com/weganat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://fb.me/react-with-addons-0.14.0.js"></script> | |
<script src="http://fb.me/react-dom-0.14.0.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id=example></div> | |
<h1>Hello world</h1> | |
<script id="jsbin-javascript"> | |
//jshint esnext:true | |
'use strict'; | |
var score = 900; | |
var wrath = "angry"; | |
var myObj = { | |
user: 'John', | |
score: 20012, | |
angry: 99, | |
highScore: function highScore() { | |
console.log('Your score is' + this.score); | |
} | |
}; | |
console.log(myObj.score); | |
console.log(myObj.highScore()); | |
console.log(myObj[wrath]); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<script src="//fb.me/react-with-addons-0.14.0.js"><\/script> | |
<script src="//fb.me/react-dom-0.14.0.js"><\/script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id=example></div> | |
<h1>Hello world</h1> | |
</body> | |
</html></script> | |
<script id="jsbin-source-javascript" type="text/javascript"> | |
//jshint esnext:true | |
let score = 900; | |
let wrath = "angry" | |
let myObj = { | |
user: 'John', | |
score: 20012, | |
angry: 99, | |
highScore(){ | |
console.log('Your score is' + this .score) | |
} | |
}; | |
console.log(myObj.score); | |
console.log(myObj.highScore()); | |
console.log(myObj[wrath]);</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//jshint esnext:true | |
'use strict'; | |
var score = 900; | |
var wrath = "angry"; | |
var myObj = { | |
user: 'John', | |
score: 20012, | |
angry: 99, | |
highScore: function highScore() { | |
console.log('Your score is' + this.score); | |
} | |
}; | |
console.log(myObj.score); | |
console.log(myObj.highScore()); | |
console.log(myObj[wrath]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment