QuestenaPractice that shows what to review next
Question 59

After result = [1].concat([2]), which statement is correct?

  1. result is [1, 2], and both inputs are unchangedCorrect answer
  2. the first input becomes [1, 2]
  3. result is the number 2
  4. the second input becomes empty

Explanation

concat returns a new shallow array containing values from both inputs, so result contains 1 and 2 while the input arrays remain unchanged. Claiming that the first input grows confuses combination with a mutating append operation.

Continue with this test

Start practice
Question 59: After result = [1].concat([2]), which statement is correct? · JavaScript Fundamentals · Questena