Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

What is the primary feature of an arrow function?

View

What is the correct syntax for a single-parameter arrow function?

View

Which of the following statements about arrow functions is true?

View

What is the output of this code? const greet = () => "Hello"; console.log(greet());

View

Which of the following does an arrow function inherit?

View

What will this arrow function return? const add = (a, b) => a + b; console.log(add(3, 4));

View

How does an arrow function differ from a regular function in terms of this?

View

What will the following arrow function return? const double = num => num * 2; console.log(double(5));

View

Which of the following scenarios is not ideal for using arrow functions?

View

What is the result of this code? const func = () => ({ name: 'John' }); console.log(func());

View

What is the primary feature of an arrow function?

It has access to its own this
It automatically returns objects
It does not have its own 'this' binding
It uses the function keyword

What is the correct syntax for a single-parameter arrow function?

let func = (x) => { return x * 2; }
let func = x => x * 2;
let func = function(x) { return x * 2; }
let func = x => { return x; }

Which of the following statements about arrow functions is true?

They bind their own arguments object
They cannot be anonymous
They automatically return values when written in single-expression form
They have an implicit this binding

What is the output of this code? const greet = () => "Hello"; console.log(greet());

"Hello"
Hello
undefined
null

Which of the following does an arrow function inherit?

its own 'this'
The this of the surrounding scope
The 'this' of its own scope
The global object

What will this arrow function return? const add = (a, b) => a + b; console.log(add(3, 4));

7
34
undefined
Error

How does an arrow function differ from a regular function in terms of this?

Arrow functions define their own this context
Arrow functions inherit this from their surrounding context
Arrow functions bind 'this' globally
Arrow functions don't have a 'this' context

What will the following arrow function return? const double = num => num * 2; console.log(double(5));

5
10
25
NaN

Which of the following scenarios is not ideal for using arrow functions?

Object methods
Callbacks
Map functions
Simple one-line operations

What is the result of this code? const func = () => ({ name: 'John' }); console.log(func());

{ name: 'John' }
name: 'John'
undefined
Error