Problem Statement
Which statement about arrow functions is true?
Explanation
Arrow functions are short and modern alternatives to normal functions.
They do not create their own 'this' value. Instead, they use the 'this' from the outer scope.
This makes them perfect for callbacks where you want to use the same context.
They cannot be used as constructors and do not have an arguments object.
Use them for clean, compact logic, but avoid them in methods that rely on dynamic 'this'.
Code Solution
SolutionRead Only
const person = {
name: 'John',
greet: () => console.log('Hello ' + this.name)
};
person.greet(); // 'Hello undefined' (no own this)