Created
May 31, 2021 07:04
-
-
Save skrajewski/3c6690519a8b13bfdc3ac5ae203cacdb to your computer and use it in GitHub Desktop.
Revisions
-
skrajewski revised this gist
May 31, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ function prepareTest() { this.test = "abcd"; } // global -
skrajewski created this gist
May 31, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ Output in Browser: ```js undefined undefined {test: "abcd"} "abcd" ``` Output in Node: ```js undefined undefined prepareTest { test: 'abcd' } undefined ``` 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ function prepareTest() { this.test = "abcd"; } // global console.log(this.test); const a = prepareTest(); const b = new prepareTest() console.log(a); console.log(b); // global console.log(this.test);