Answer the question
In order to leave comments, you need to log in
What is the difference between the description of methods in classes?
Can you tell me what's the difference?
How will this stuff behave in ES6 AND ES7/NEXT
func1 and func2 have automatic this binding under the hood and will always be bound to Todo? is it a portotype or not?
func3 doesn't have any magic binding, it's a class prototype.
Did I understand everything correctly and are there any other differences?
class Todo extends Component {
state = {};
const func0= (id) => {
return 1+1;
};
func1= (id) => {
};
const func2= ({ username }) => <p>The logged in user is: {username}</p>;
func3() {
return 1;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question