Suggested answer

Arrow functions (const fn = (x) => x * 2;) are concise function expressions with key differences:

1. Lexical this: Arrow functions do not have their own this — they inherit this from the enclosing lexical scope. This is the most important difference. Regular functions bind this dynamically based on how they are called (call-site).
2. No arguments object: Arrow functions do not have an arguments object — use rest parameters (...args) instead.
3. Cannot be used as constructors: Cannot use new with an arrow function.
4. No prototype property. Lexical this makes arrow functions ideal for callbacks in class methods and event handlers where you want to preserve the class instance's this.

Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.

Community comments (0)

No comments yet.

Sign in or create a free account to add a comment. Comments are moderated before they appear.

Plain text only, 3–2000 characters. A moderator reviews every comment before it is published.