You are given a number N. Create a program that loops through all of the numbers from N to 1 and prints them. N will always be positive.
Input
Output
5
4
3
2
1
Here's the answer:
function fromNtoOne(args) { let input = args[0]; for (var i = input; i >= 1; i--) { console.log(i); } }
622 questions
979 answers
129 comments
53 users