Skip to content

Instantly share code, notes, and snippets.

@sagardere
Created May 22, 2018 16:40
Show Gist options
  • Save sagardere/3879684de56402e92ba694cf0efed41d to your computer and use it in GitHub Desktop.
Save sagardere/3879684de56402e92ba694cf0efed41d to your computer and use it in GitHub Desktop.
//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