Created
March 28, 2017 07:10
-
-
Save abhinavdhasmana/d5e19fea6b0ce5abfc9be2889d040d50 to your computer and use it in GitHub Desktop.
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
'use strict'; | |
function whoAmI() { | |
console.log('I am in local scope:', this); | |
function insideFunction() { | |
console.log('I am an inside function:', this); | |
} | |
insideFunction.apply(this); | |
} | |
this.myName = 'Abhinav'; | |
whoAmI.apply(this); | |
// Output | |
// I am in local scope: { myName: 'Abhinav' } | |
// I am an inside function: { myName: 'Abhinav' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment