for (var input = 1; input < 4; input++) {
console.log(input);
}
for (var input = 1; input <= 4; input++) {
console.log(input);
}
// program to display numbers from 1 to 5
const n = 5;
// looping from i = 1 to 5
// in each iteration, i is increased by 1
for (let i = 1; i <= n; i++) {
console.log(i); // printing the value of i
}
1
2
3
4
5
6
7
8
9
10