function CreatePigLatinPhrase(sentence) {
const pigLatinSentence = [];
const words = splitSentenceIntoWords(sentence);
words.forEach((word) => {
const wordType = checkWhatWordItIs(word.toLowerCase());
const wordInPigLatin = convertWordToPigLatin(wordType, word.toLowerCase());
pigLatinSentence.push(wordInPigLatin);
});
let outputSentence = '';
pigLatinSentence.forEach((word) => {
outputSentence += word + ' '
})
return outputSentence.substring(0, outputSentence.length) + '.';
}