const toggleCase = (string) => { const newText = string .toUpperCase() .split(" ") .map(function(word) { return word.charAt(0).toLowerCase() + word.slice(1); }) .join(" "); return newText; };