0
Need to build MVC shape
The user enters his name, you need to display each letter of his name in the console, starting with the last. help solve the problem, otherwise it does not come to mind how to do it let userName = prompt ('enter your user name'); let test = []; for(var i = 0; i < userName.length; i++) { test.push(userName[i]) } console.log(test.reverse('')) Of course, I'm not sure yet if I wrote everything correctly, since I am a beginner and I also lack practice.
2 Réponses
+ 4
FishMan FishMAn , yes your code works. You can achieve it also this way after the first line: userName.split("").reverse("").forEach(letter => console.log(letter));
+ 1
I can't figure out how to write an mvc template. You can help?