JavaScript · Junior · Question 16 of 75

How does an arrow function differ from a regular one?

Explanation

An arrow takes this from the scope where it was created, which makes it handy for callbacks inside methods. But it doesn't work as an object method: this won't point to the object. Only function declarations are fully hoisted.

Further reading

Problem with a question

JavaScript · Junior · question 16

Test yourself

Take the JavaScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz