Need to build MVC shape | Sololearn: Learn to code for FREE!


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.

8/1/2020 8:10:47 AM

FishMan FishMAn

2 Answers

New Answer


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));


I can't figure out how to write an mvc template. You can help?