Created
May 13, 2016 19:59
-
-
Save kirankumaramruthaluri/d002bc09252883eb5e7fa07d8dea34cd to your computer and use it in GitHub Desktop.
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 characters
/** | |
* Static class - this new MyClass will create scope but with same objects and class which are static, which tells that tells being as | |
* a static class, it can be told as MyClass will not be `this` giving its reference to MyClass for all instances | |
* and can shared | |
*/ | |
function MyClass() | |
{ | |
function add(num1, num2) { return (num1+num2); } | |
function sub(num1, num2) { return (num1-num2); } | |
MyClass.add = add; | |
MyClass.subtract = sub; | |
return MyClass; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment