Hi so basically I have a prompt that will make the user enter a phrase or phrases and when I return it I need to make each word an acronym and capital letter, for example: If I wrote "hello welcome to canada" it should come up as "HWTC". I have to use a either a for loop or while loop to do this and this is what I have right now but not sure how to make it so every word comes up as an acronym instead of just the first word I write. Thanks
function acronym () {
let word = prompt("enter a word that you want to change into an acronym")
let result = word
while (word.charAt(4) === "") {
word = word.charAt(0)
word = word.toUpperCase()
} document.getElementById("string").innerHTML = result;
}