Created
April 29, 2016 18:08
-
-
Save easierbycode/194770077ad51c26095aa7bfac7ddf19 to your computer and use it in GitHub Desktop.
overriding a method in subclass
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
class Project { | |
getTaskCount() { | |
return 50; | |
} | |
} | |
class SoftwareProject extends Project { | |
getTaskCount() { | |
return 100; | |
} | |
} | |
let sp = new SoftwareProject(); | |
sp.getTaskCount() | |
// 100 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment