These are chat archives for camperbot/bonfire-arguments-optional

25th
Feb 2016
Michael Poutre
@M1kep
Feb 25 2016 20:43
Hey there
So I think i'm doipng this the hardway
function add() {
  for(x = 0; x < arguments.length; x++) {
    if(typeof(arguments[x]) != "number") {
       return undefined;
     }
  }
  if(arguments.length > 1) {
    sum = 0;
    for(y = 0; y < arguments.length; y++) {
      sum += arguments[y];
    }
    return sum;
  }
  originalNum = arguments[0];
  return function(z) {
    return add(originalNum + z);
  };
}

add(2)(3);
And it doesnt even work