Skip to content

Instantly share code, notes, and snippets.

@aledoroshenko
Last active October 17, 2016 16:24
Show Gist options
  • Save aledoroshenko/49de07cd9b41e644985e4cdf3686f1f8 to your computer and use it in GitHub Desktop.
Save aledoroshenko/49de07cd9b41e644985e4cdf3686f1f8 to your computer and use it in GitHub Desktop.
esnextbin sketch
<!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>
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());
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependecies": {
"lodash": "~4.14.1",
"expect": "~1.20.2"
}
}
'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