Created
March 29, 2018 14:45
-
-
Save aryak007/03bcb897ce1789f63e0d6b8e1451f089 to your computer and use it in GitHub Desktop.
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
| function foo(){ | |
| console.log(this.bar); | |
| } | |
| var bar = "bar1"; | |
| var o2 = { | |
| bar:"bar2", | |
| foo:foo | |
| }; | |
| var o3 = { | |
| bar:"bar3", | |
| foo:foo | |
| }; | |
| foo(); //default binding - If in strict mode, default will make the call result undefined. If not, it will print bar1. | |
| //https://stackoverflow.com/a/19850326/2309841 | |
| o2.foo(); | |
| o3.foo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment