Skip to content

Instantly share code, notes, and snippets.

@easierbycode
Last active April 29, 2016 18:21
Show Gist options
  • Save easierbycode/407aade4a8287442faca0253138ad1b8 to your computer and use it in GitHub Desktop.
Save easierbycode/407aade4a8287442faca0253138ad1b8 to your computer and use it in GitHub Desktop.
calling super.methodName from subclass
class Project {
getTaskCount() {
return 50;
}
}
class SoftwareProject extends Project {
getTaskCount() {
return super.getTaskCount() + 25;
}
}
let sp = new SoftwareProject();
sp.getTaskCount()
// 75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment