Can anyone explain, what is wrong with this? I mean, they are both functions, right?
The new method syntax (see below) doesn’t require arrow syntax or a colon ( : ) with the function keyword.
‘‘doesnt require’’ or doesnt work at all?
I stand corrected, see answer below.
There are two ways to define methods, es5 and es6, see the documentation:
using the arrow function syntax won’t work for method,
this keyword won’t get the correct scope, so it won’t work