Created
June 3, 2018 13:35
-
-
Save harmoniemand/d6c9e3d053b9f1f5baf8204bf0fd9774 to your computer and use it in GitHub Desktop.
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 characters
String.prototype.fizz = function (i) { | |
return this + (i % 3 == 0 ? 'fizz': ''); | |
}; | |
String.prototype.buzz = function (i) { | |
return this + (i % 5 == 0 ? 'buzz': ''); | |
}; | |
for (var i = 0; i < 20; i++) { | |
console.log(i + " :".fizz(i).buzz(i)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment