made with esnextbin
Last active
October 17, 2016 16:24
-
-
Save aledoroshenko/49de07cd9b41e644985e4cdf3686f1f8 to your computer and use it in GitHub Desktop.
esnextbin sketch
This file contains hidden or 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> | |
<meta charset="utf-8"> | |
<title>ESNextbin Sketch</title> | |
<!-- put additional styles and scripts here --> | |
</head> | |
<body> | |
<!-- put markup and other contents here --> | |
</body> | |
</html> |
This file contains hidden or 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
const obj = { | |
a: 'test', | |
getPropB: function() { | |
return this.getPropA(); | |
}, | |
getPropA: function() { | |
return this.a | |
} | |
} | |
const fn = obj.getPropA; | |
const bindedFn = obj.getPropB.bind(obj); | |
console.log('propA ', obj.getPropA()); | |
console.log('propB ', obj.getPropB()); | |
console.log('bindedFn ', bindedFn()); |
This file contains hidden or 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
{ | |
"name": "esnextbin-sketch", | |
"version": "0.0.0", | |
"dependecies": { | |
"lodash": "~4.14.1", | |
"expect": "~1.20.2" | |
} | |
} |
This file contains hidden or 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
'use strict'; | |
var obj = { | |
a: 'test', | |
getPropB: function getPropB() { | |
return this.getPropA(); | |
}, | |
getPropA: function getPropA() { | |
return this.a; | |
} | |
}; | |
var fn = obj.getPropA; | |
var bindedFn = obj.getPropB.bind(obj); | |
console.log('propA ', obj.getPropA()); | |
console.log('propB ', obj.getPropB()); | |
console.log('bindedFn ', bindedFn()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment