Skip to content

Instantly share code, notes, and snippets.

@scottwarren
Created December 31, 2014 02:31
Show Gist options
  • Save scottwarren/5dbfa599a722f85e877a to your computer and use it in GitHub Desktop.
Save scottwarren/5dbfa599a722f85e877a to your computer and use it in GitHub Desktop.
Convert an English word into Pig Latin written in Javascript
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