Fill in blanks to make the variable arr3 look like the following: [1, 2, 3, 4, 5, 6, 7, 8]. const arr1= [1, 2, 3]; const arr2 = [5, 6, 7, 8]; let arr3 = [...arr1, __, ...arr2];
3/8/2019 7:01:09 PM
Shebeta Alemu15 Answers
New Answerlet a = [1,2]; let b = [3,4]; let c = [...a, ...b]; console.log(c) //outputs [1,2,3,4] There would be not third param in c
Arr1 is defined as 1,2,3 and arr2 is defined is 5,6,7,8 It’s supposed to read 1,2,3,4 and so on. Starting the clause you have to write...and the arr sequence in this case arr1. The next section is easy as it’s just the number 4 because if you look at it 4 is still missing between arr1 and arr2.
const arr1 = [1, 2, 3]; const arr2 = [5, 6, 7, 8]; let arr3 = [...arr1, 4, ...arr2];
const arr1 = [1, 2, 3]; const arr2 = [5, 6, 7, 8]; let arr3 = [ ... arr1, 4 , ...arr2];
Fill in blanks to make the variable arr3 look like the following: [1, 2, 3, 4, 5, 6, 7, 8]. const arr1 = [1, 2, 3]; const arr2 = [5, 6, 7, 8]; let arr3 = [ ... arr1, 4, ...arr2];
Answer is const arr1 = [1, 2, 3]; const arr2 = [5, 6, 7, 8]; let arr3 = [...arr1, 4, ...arr2];
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message