function sumArray(arr) {
    var sum = 0;
    arr.forEach(function (item, index, array) {
        (function (n) {
            return !isNaN(parseFloat(n)) && isFinite(n);
        }(item)) ? sum += item: sum = sum;
    });
    return sum;
}
/* sumArray()
 *
 * Write a function <code>sumArray()</code> that accepts an array of
 * numbers and returns the sum of all numbers in the array
 *
 * I have purposely written this function to be a little confusing by
 * defining an anonymous function that tests each item in the array
 * to see if it is a number, this is then used in a ternary statement
 */
sumArray()
Write a function sumArray() that accepts an array of
numbers and returns the sum of all numbers in the array

I have purposely written this function to be a little confusing by
defining an anonymous function that tests each item in the array
to see if it is a number, this is then used in a ternary statement
sumArray () Write a function sumArray () that accepts an array of numbers and returns the sum of all numbers in the array I have purposely written this function to be a little confusing by defining an anonymous function that tests each item in the array to see if it is a number this is then used in a ternary statement
function sumArray(arr) {
    var sum = 0;
    arr.forEach(function (item, index, array) {
        (function (n) {
            return !isNaN(parseFloat(n)) && isFinite(n);
        }(item)) ? sum += item: sum = sum;
    });
    return sum;
}
function sumArray ( arr ) { var sum = 0 ; arr . forEach ( function ( item , index , array ) { ( function ( n ) { return ! isNaN ( parseFloat ( n ) ) && isFinite ( n ) ; } ( item ) ) ? sum += item : sum = sum ; } ) ; return sum ; }
sumArray()
 Write a function <code>sumArray()</code> that accepts an array of
 numbers and returns the sum of all numbers in the array
sumArray () Write a function <code > sumArray () < / code > that accepts an array of numbers and returns the sum of all numbers in the array