Created
February 25, 2017 09:20
-
-
Save ticidesign/c74f7bac43a3c6e1eea8863b67555c5e to your computer and use it in GitHub Desktop.
A function that takes a size and returns a string of alternating '1s' and '0s'.
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
function stringy(size) { | |
// your code here | |
var word = ""; | |
for(var i = 0; i < size; i++) { | |
word += i%2 === 1? "0" : "1"; | |
} | |
return word; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment