$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · hard · #130

What is logged?

console.log(['a', 'b'].forEach(() => {}), ['a'].map(() => {}));
  1. undefined [undefined]
  2. undefined []
  3. [] []
  4. undefined undefined
forEach returns undefined; map returns an array of each callback's undefined result.
Play Problem Solving ▸