Apparently I've done this kata before...but I don't know if that even helped me this time. It's so hard to wrap my brain around.
function zero() { return arguments.length ? arguments[0](0) : 0; } function one() { return arguments.length ? arguments[0](1) : 1; } function two() { return arguments.length ? arguments[0](2) : 2; } function three() { return arguments.length ? arguments[0](3) : 3; } function four() { return arguments.length ? arguments[0](4) : 4; } function five() { return arguments.length ? arguments[0](5) : 5; } function six() { return arguments.length ? arguments[0](6) : 6; } function seven() { return arguments.length ? arguments[0](7) : 7; } function eight() { return arguments.length ? arguments[0](8) : 8; } function nine() { return arguments.length ? arguments[0](9) : 9; } function plus(b) { return function(a) { return Math.floor(a + b) } } function minus(b) { return function(a) { return Math.floor(a - b) } } function times(b) { return function(a) { return Math.floor(a * b) } } function dividedBy(b) { return function(a) { return Math.floor(a / b) } }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Apparently I've done this kata before...but I don't know if that even helped me this time. It's so hard to wrap my brain around.