Created
February 18, 2020 02:21
-
-
Save manobi/d963e070c86f2641ed209209077c1838 to your computer and use it in GitHub Desktop.
pure smallEnought version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* pure smallEnought version | |
* @param {array} a | |
* @param {number} limit | |
*/ | |
const smallEnought = ([head, ...tail], limit) => (!head && !tail.length) || ((head > limit) ? false : smallEnought(tail, limit)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tests