- What is a first-class function, and how does it differ from other types of functions?
- How can first-class functions be used in JavaScript to pass functions as arguments to other functions?
- Explain the difference between array.map(), array.reduce(), and array.filter(). In what scenarios would you use each of these array methods?
- Write a function that uses array.map() to double every number in an array. How would you modify the function to triple every number instead?
- Write a function that uses array.filter() to return only the even numbers in an array. How would you modify the function to return only the odd numbers instead?
- Write a function that uses array.reduce() to find the sum of all the numbers in an array. How would you modify the function to find the product of all the numbers instead?
Created
March 23, 2023 17:11
-
-
Save halitbatur/7d0ea3315d891b0c621741f2575c6aa3 to your computer and use it in GitHub Desktop.
first-class functions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment