Created
May 22, 2018 16:40
-
-
Save sagardere/3879684de56402e92ba694cf0efed41d 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
//If you create the static methods in classes, then you call static methods without creating the class instances. | |
class Tasks{ | |
static Addition(a , b){ | |
return a+b; | |
} | |
static Subtraction(a , b){ | |
return a-b; | |
} | |
static Multiplication(a , b){ | |
return a*b; | |
} | |
static Division(a , b){ | |
return a/b; | |
} | |
} | |
//call to method | |
let result = Tasks.Addition(22,88); | |
console.log("Addition is " , result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment