Why are methods in JavaScript classes not declared with the function-keyword.
eg. normal functions are declared as:
function doX() {
//logic
}
while methods in classes have to be declared as:
class Y {
doX() {
// logic
}
}
Why is this?
Comments
Post a Comment