lib/split-arc.js
function closestToZero(numbers, maxNumber) {
    //returns the index of value closest to 0
    var positiveNumbers = numbers.map(function(number) {
        return Math.abs(number);
    });

    var sortedPositiveNumbers = positiveNumbers.sort(function(a, b) {
        return (a - b);
    });

    return sortedPositiveNumbers[0];
}
function closestToZero(numbers, maxNumber) {
    //returns the index of value closest to 0
    var positiveNumbers = numbers.map(function(number) {
        return Math.abs(number);
    });

    var sortedPositiveNumbers = positiveNumbers.sort(function(a, b) {
        return (a - b);
    });

    return sortedPositiveNumbers[0];
}
function closestToZero ( numbers , maxNumber ) { //returns the index of value closest to 0 var positiveNumbers = numbers . map ( function ( number ) { return Math . abs ( number ) ; } ) ; var sortedPositiveNumbers = positiveNumbers . sort ( function ( a , b ) { return ( a - b ) ; } ) ; return sortedPositiveNumbers [ 0 ] ; }
Return the number that's closest to zero
Return the number that s closest to zero