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 syntax for an arrow function with one parameter?

View

How do you write an arrow function with no parameters? a) const func = () => {}

View

What is the primary difference between arrow functions and regular functions?

View

What happens if you omit curly braces in an arrow function?

View

What is the output of this code: const add = (a, b) => a + b; console.log(add(2, 3));?

View

Can you use arrow functions as methods in objects?

View

What is the result of this code: const func = () => 42; console.log(func());?

View

Can you use arrow functions with map(), filter(), and reduce()?

View

What is the value of this in an arrow function defined inside a regular function?

View

What is the purpose of the implicit return in arrow functions?

View

What is the syntax for an arrow function with one parameter?

const func = param => {}
const func = (param) => {}
const func = param => return {}
Both a and b

How do you write an arrow function with no parameters? a) const func = () => {}

const func = param => {}
const func = () => {}
const func = {} => {}
const func = [] => {}

What is the primary difference between arrow functions and regular functions?

Arrow functions don't support arguments
Arrow functions don't have their own this context
Arrow functions can't return values
Arrow functions are always async

What happens if you omit curly braces in an arrow function?

It returns the value automatically
It throws an error
It runs in strict mode
It becomes a normal function

What is the output of this code: const add = (a, b) => a + b; console.log(add(2, 3));?

5
23
undefined
It throws an error

Can you use arrow functions as methods in objects?

No, they don't have access to this
Yes, but only with async objects
Yes, with normal access to this
No, arrow functions don't work with objects

What is the result of this code: const func = () => 42; console.log(func());?

undefined
42
null
It throws an error

Can you use arrow functions with map(), filter(), and reduce()?

No, they don't support arrow functions
Yes, arrow functions are often used for callbacks in these methods
Yes, but only if they return strings
No, arrow functions don't work with arrays

What is the value of this in an arrow function defined inside a regular function?

It refers to the global object
It refers to the arrow function itself
The this value of the enclosing regular function
It is undefined

What is the purpose of the implicit return in arrow functions?

To prevent errors in code
To create async functions
To optimize memory usage
To automatically return values without the return keyword