EasyFunctions📖 Theory Question

How do arrow functions differ from regular functions?

💡

Hint

No own this, no arguments object, no new, no prototype

Full Answer

Arrow functions are not just shorter syntax — key behavioral differences:

  • No own this — inherits lexical this from outer scope
  • No arguments object — use rest params (...args)
  • Cannot be constructors — new throws TypeError
  • No prototype property
const obj = {
  name: 'Dev',
  regular() { console.log(this.name); },  // 'Dev'
  arrow: () => console.log(this.name),    // undefined
};
💡 Use arrow fns for callbacks (inherit this). Use regular fns for methods and constructors.

More Functions Questions

EasyWhat is the difference between call, apply, and bind?EasyWhat is a pure function and why does it matter?EasyWhat are Higher-Order Functions (HOF)?EasyWhat is an IIFE (Immediately Invoked Function Expression) and when do you use it?

Practice this in a timed sprint →

5 free questions, no signup required

⚡ Start Sprint