Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var up = function(current, goal) { // add types
- console.log(current) // printf
- if(current.length === goal) {
- down(current.slice(0, -1), 0)
- } else {
- up(current + '0', goal)
- }
- }
- var down = function(current, goal) { // add types
- console.log(current)
- if(current.length !== goal) { // check how measure length in your language
- down(current.slice(0, -1), goal)
- }
- }
- up('0', 10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement