function addTogether() {
	// check if we have less than 2 arguments
	if (arguments.length <= 1) {
		if (typeof arguments[0] !== 'number') {
			// if first and only argument is not a number, exit
			return undefined;
		}
		// if it is a number, save it in a variable and return a 
		// function asking for a second argument
		let a = arguments[0];
		return function(secondArg) {
		  if (typeof a !== 'number' || typeof secondArg !== 'number') {
			// if either argument is not a number, exit
			return undefined;
		  } else {
			// both arguments are numbers, return their sum
			return a + secondArg;
		  }
		}
	// we have already 2 or more arguments
	} else {
		for (let i = 0; i < arguments.length; i++) {
			if (typeof arguments[i] !== 'number') {
				// as soon as one of the arguments is found not being a 
				// number, exit
				return undefined;
			}
		}
		// all arguments are numbers, return their sum
		return arguments[0] + arguments[1];
	}
	// general catch all
	return undefined;
}
// If either argument isn't a valid number, return undefined.
If either argument isn't a valid number, return undefined.
If either argument isn ' t a valid number return undefined .
function addTogether() {
	if (arguments.length <= 1) {
		if (typeof arguments[0] !== 'number') {
			return undefined;
		}
		let a = arguments[0];
		return function(secondArg) {
		  if (typeof a !== 'number' || typeof secondArg !== 'number') {
			return undefined;
		  } else {
			return a + secondArg;
		  }
		}
	} else {
		for (let i = 0; i < arguments.length; i++) {
			if (typeof arguments[i] !== 'number') {
				return undefined;
			}
		}
		return arguments[0] + arguments[1];
	}
	return undefined;
}
function addTogether ( ) { if ( arguments . length <= 1 ) { if ( typeof arguments [ 0 ] !== 'number' ) { return undefined ; } let a = arguments [ 0 ] ; return function ( secondArg ) { if ( typeof a !== 'number' || typeof secondArg !== 'number' ) { return undefined ; } else { return a + secondArg ; } } } else { for ( let i = 0 ; i < arguments . length ; i ++ ) { if ( typeof arguments [ i ] !== 'number' ) { return undefined ; } } return arguments [ 0 ] + arguments [ 1 ] ; } return undefined ; }
If either argument isn't a valid number, return undefined.
If either argument isn ' t a valid number return undefined .
// check if we have less than 2 arguments // if first and only argument is not a number, exit // if it is a number, save it in a variable and return a  // function asking for a second argument // if either argument is not a number, exit // both arguments are numbers, return their sum // we have already 2 or more arguments // as soon as one of the arguments is found not being a  // number, exit // all arguments are numbers, return their sum // general catch all