For example:
makeAbbr('central processing unit') === 'CPU'
I could not find my mistake. I appreciate your help.
function makeAbbr(words) {
let abbreviation = words[0];
for (let i = 1; i < words.length; i++) {
if (words[i] === '') {
abbreviation += words[i + 1];
}
}
return abbreviation.toUpperCase();
}
console.log(makeAbbr('central processing unit'));
word: string
is a TypeScript thing, not JS. – Cerement