Question: 2. Use the spread operator to produce an array named seasons by concatenating the following 2 arrays and adding extra elements Cool! and Super Hot

 2. Use the spread operator to produce an array named seasons

2. Use the spread operator to produce an array named seasons by concatenating the following 2 arrays and adding extra elements "Cool!" and "Super Hot Summer!" as seasons. Input arrays: let cold = ['autumn', 'winter']; let warm = ['spring', 'summer'l; Output seasons array: ["Cool!", 'autumn', 'winter', 'spring', 'summer', "Super Hot Summer!"] 3. Call the Math.max() function and pass the nums array to it. Do not forget to use spread operator to convert the array to multiple arguments expected by the max function. let nums = [1, 2, 3, 4, 45, 5, 6] 4. Consider the following the square function and nums array. function square(x) { return x **2; } let numbers = [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 101; a. Use the square function along with the array map function to square the elements of nums array and assigned the results to squaredNums. Then Display squared Nums. b. Enhance the implementation done in previous question by removing the square function and using anonymous arrow function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!