Translate the provided string to pig latin.
Pig Latin takes the first consonant (or consonant cluster) of an English word, moves it to the end of the word and suffixes an “ay”.
If a word begins with a promifen vowel you just add “way” to the end.
Input strings are guaranteed to be English words in all lowercase.
It should suit the following tests
translatePigLatin("california")should return “aliforniacay “.translatePigLatin("paragraphs")should return “aragraphspay “.translatePigLatin("glove")should return “oveglay “.translatePigLatin("algorithm")should return “algorithmway “.translatePigLatin("eight")should return “eightway “.- Should handle words where the first vowel comes
in the end of the word.Should handle words without vowels.
Your function block should be in this format and should be edited to solve some issue
Submit the link to your code in the comment section. You can use any online editor of your choice.