Last active
September 27, 2018 16:08
-
-
Save yunpengn/55d8631f8960c3d1aca807d47df35ba3 to your computer and use it in GitHub Desktop.
To teach JavaScript without the dot operator (this is supported by Common.js & Node.js)!
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
require("./utils.js"); | |
// `add` is inserted into global frame. Do not need `utils.add` anymore! | |
add(1, 2); |
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
global.add = function (x, y) { | |
console.log("hello"); | |
return x + y; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, that's great!