Last active
August 31, 2021 22:07
-
-
Save manila/2f37c11ea8c3481be2ac946658c0bddc to your computer and use it in GitHub Desktop.
Revisions
-
manila revised this gist
Aug 31, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -21,4 +21,4 @@ const cracklePop = (start, end, step = 1) => { cracklePop(num + step, end, step) } cracklePop(1, 100) -
manila created this gist
Aug 31, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ const cracklePop = (start, end, step = 1) => { let num = start if (num > end) { return false } let result = num if (num % 3 == 0 && num % 5 == 0) { result = 'CracklePop' } else if (num % 3 == 0) { result = 'Crackle' } else if (num % 5 == 0) { result = 'Pop' } console.log(result) cracklePop(num + step, end, step) } cracklePop(1, 100)