$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · easy · #98

What goes in the blank?

// returns a new array with each number doubled
function doubleAll(nums) {
  return nums.____(n => n * 2);
}
// doubleAll([1,2,3]) -> [2,4,6]

Answer: map (also accepted: map, map())

map() returns a new array of transformed values.
Play Problem Solving ▸