The JavaScript code segment below calls a function magicArray that has two array parameters ( arr1 and
Fantastic news! We've Found the answer you've been seeking!
Question:
The JavaScript code segment below calls a functionmagicArraythat has two array parameters (arr1 and arr2). The function is intended to createand return an array arr3 that will contain all of the elements of arr1 followed by all of the elements of arr2.
Two Examples:
arr1 | arr2 | arr3 (this array is returned) |
1, 2, 3, 4 | 9, 8, 7, 6, 5 | 1, 2, 3, 4, 9, 8, 7, 6, 5 |
11, 21, 34, 46 | 98, 72 | 11, 21, 34, 46, 98, 72 |
The code segment below also calls a functionprintArraywhich prints the elements of an array in a vertical format. Your code should work as intended for arrays of any size.
Related Book For
Corporate Finance
ISBN: 9781265533199
13th International Edition
Authors: Stephen Ross, Randolph Westerfield, Jeffrey Jaffe
Posted Date: