Questenaتمرینی که نشان می‌دهد بعد چه چیزی را مرور کنید
سؤال 59

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

  1. result is [1, 2], and both inputs are unchangedپاسخ درست
  2. the first input becomes [1, 2]
  3. result is the number 2
  4. the second input becomes empty

توضیح

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.

ادامهٔ این آزمون

شروع تمرین
سؤال 59: After result = [1].concat([2]), which statement is correct? · JavaScript Fundamentals · Questena