const invertCase = (string) => { const newText = string.replace(/./g, (c) => c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase() ); return newText };