Add to Chrome
✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Was macht der Spread-Operator in folgendem Beispiel?
const arr1 = [1, 2, 3];const arr2 = [...arr1, 4, 5];console.log(arr2);
const arr1 = [1, 2, 3];
const arr2 = [...arr1, 4, 5];
Er fügt arr1 in arr2 als verschachteltes Array ein.
arr1
arr2
Er kopiert arr1 in arr2 und fügt 4 und 5 hinzu.
Er erstellt eine Referenz auf arr1 in arr2.
Er erstellt ein neues Array, das nur die Zahlen 4 und 5 enthält.
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!