We should have a method that duplicates an array and all subarrays, like this:
helpful.deepDuplicateArray([1, 2, [3, 4], 5]) => [1, 2, [3, 4], 5]
We encourage using the existing duplicateArray method and recursion to create the deepDuplicateArray method.
We should have a method that duplicates an array and all subarrays, like this:
We encourage using the existing
duplicateArraymethod and recursion to create thedeepDuplicateArraymethod.