const length = 4;
const numbers = [];
for (var i = 0; i < length; i++){
numbers.push(i + 1);
}
console.log(numbers)
1 Like
output of the following code will be----[1,2,3,4]
const length = 4;
const numbers = [];
for (var i = 0; i < length; i++){
numbers.push(i + 1);
}
console.log(numbers)
output of the following code will be----[1,2,3,4]