Created
December 31, 2014 02:31
-
-
Save scottwarren/5dbfa599a722f85e877a to your computer and use it in GitHub Desktop.
Convert an English word into Pig Latin written in Javascript
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 pigLatin(englishWord) { | |
return englishWord.substr(1, englishWord.length) + englishWord.substr(0, 1) + 'ay'; | |
}; | |
// example: console.log(pigLatin('Hello')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment