Skip to content

Instantly share code, notes, and snippets.

@lesniakania
Last active November 24, 2015 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesniakania/5c7ec45e97cee21452ee to your computer and use it in GitHub Desktop.
Save lesniakania/5c7ec45e97cee21452ee to your computer and use it in GitHub Desktop.
// calculator.js
(function(root) {
var calculator = {
sum: function(a, b) { return a + b; }
};
root.Calculator = calculator;
})(this);
// app.js
console.log(Calculator.sum(1, 2)); // => 3
@gitjul
Copy link

gitjul commented Nov 23, 2015

not Calculator.sum?

@lesniakania
Copy link
Author

👍, thanks

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