I'm learning JavaScript and I really want to understand why this function is not working. Please explain me what am I doing wrong here and how I could make it work. I really want to keep it simple like it is so I can understand what I'm doing wrong and right.
var input = prompt("Write a number");
function around() {
for (var x = 0; x < input.lenght ; x++) {
console.log(input.reverse());
}
}
around();