Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Methods and the function-keyword in JS-classes

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