Created
July 7, 2015 02:01
-
-
Save noyobo/af60b62f29f59a0e252d to your computer and use it in GitHub Desktop.
get star length
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
var stars = '✮✮✮✮✮✩✩✩✩✩'; | |
var score = function(len) { | |
return stars.substring(5 - len, 10 - len) | |
} | |
console.log(score(1)); | |
console.log(score(2)); | |
console.log(score(3)); | |
console.log(score(4)); | |
console.log(score(5)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment