This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Given a JavaScript array, function flattens the array and returns the sum of all primitive-type numbers in the array. | |
The function works recursively. | |
*/ | |
function flattenAndAdd(arrayToFlatten) { | |
var originalArray = arrayToFlatten; | |
var repeat = 1; |
NewerOlder