Created
June 11, 2020 03:21
-
-
Save alexesca/aebdbf90933021c2cf717a97cbdbc9a8 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
export class MyClass { | |
static add(num1, num2) { | |
return num1 + num2; | |
} | |
subtract(num1, num2) { | |
return num1 - num2; | |
} | |
} | |
// MyClass.add(1,2) returns 3 | |
// MyClass.subtract(1,2) gives an error because you need to call new MyClass() before calling the subtract method. | |
// new MyClass().subtract(1,2) should return -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment