Question: To speak the Pig Latin code language, move the first letter of each word to the end of the word and add ay to the

To speak the "Pig Latin" code language, move the first letter of each word to the end of the word and add "ay" to the end. For example, Pig Latin form of mathematics would be athematicsmay. Write a function using JavaScript that returns the Pig Latin form of the first word in a string passed to it. You may assume that the string contains only letters, but you cannot assume the string contains only one word. For example:

var t = pword("This is the last code question") would define t to be histay.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!