Skip to content

Instantly share code, notes, and snippets.

@yunpengn
Last active September 27, 2018 16:08
Show Gist options
  • Save yunpengn/55d8631f8960c3d1aca807d47df35ba3 to your computer and use it in GitHub Desktop.
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)!
require("./utils.js");
// `add` is inserted into global frame. Do not need `utils.add` anymore!
add(1, 2);
global.add = function (x, y) {
console.log("hello");
return x + y;
};
@martin-henz
Copy link

Oh, that's great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment