In this video I'll be taking you step by step in detail how I solved the "Arguments Optional" challenge in 5 easy steps using javascript on FreeCodeCamp.
The steps I took to complete this challenge are as follows(I go into more detail in the video):
STEP 1
Check if all arguments are numbers
STEP 2
Check how many arguments got passed in
STEP 3
If more than 1 return sum else return a function
STEP 4
Check the type of the second argument
STEP 5
Return sum if it's a number, undefined if it's not.
Useful links:
Medium article on currying: https://goo.gl/1qQ9BQ
FunFunFunction video on currying: https://goo.gl/XTaUv4
some(): https://goo.gl/rt94s8
reduce(): https://goo.gl/4snKb7