Thanks to visit codestin.com
Credit goes to github.com

Skip to content

imjoshuabailey/piglatinify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Piglatinify

A simple function that takes a string of words and returns them in pig latin.

Rules

  • split string by whitespace into an array of strings
  • for loop through the array
  • .map through each string
  • ignoring all non-letter characters
  • if selected string starts with a vowel add "way" to the end
  • if the selected string starts with consonants, slice all consonants before the first vowel (if consonants includes "qu" "u" is a consonant,) and push them onto the end of the selected string, add "ay" to the end of string
  • join all strings back into one long string

About

Takes in a sentence and returns the sentence in pig latin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published