Solutions/ranran2121_solutions.js
//Write a function sub that is generalized for any amount of arguments
Write a function sub that is generalized for any amount of arguments
Write a function sub that is generalized for any amount of arguments
function sub(...nums) {
  let sub = nums[0];
  for (let i = 1; i < nums.length; i++) {
    sub -= nums[i];
  }
  return sub;
}
function sub ( ... nums ) { let sub = nums [ 0 ] ; for ( let i = 1 ; i < nums . length ; i ++ ) { sub -= nums [ i ] ; } return sub ; }
Write a function sub that is generalized for any amount of arguments
Write a function sub that is generalized for any amount of arguments