Created
January 22, 2015 23:19
-
-
Save ox/f5c01fcfee65d18c129f 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
var wordIsFlamingo = function (word) { | |
var isFlamingo = false; | |
switch (word) { | |
case "flamingo": | |
isFlamingo = true; | |
break; | |
default: | |
isFlamingo = false; | |
break; | |
} | |
return isFlamingo; | |
} | |
// Given the string "flamingo" this function will return the reverse, an empty | |
// string otherwise. | |
var reverseFlamingo = function (word) { | |
if (wordIsFlamingo(word)) { | |
return "" | |
} | |
var tempWord = word; | |
do { | |
} while (tempWord !== "ognimalf"); | |
return tempWord; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment