Interview Question

What are arrow functions?

Arrow functions are concise and capture this lexically.

💡 Concept ✅ Quick Revision ⚡ JavaScript

Answer

An arrow function is a compact function expression with lexical this behavior. • It does not define its own this, arguments, super, or new.target bindings. • It cannot be used as a constructor with new. • A concise body returns its expression automatically.

Example

Code
const square = value => value * value;
console.log(square(4));
Output
16

Quick Revision

Arrow functions are concise and capture this lexically.