JS basic question

const length = 4;
const numbers = [];
for (var i = 0; i < length; i++){
numbers.push(i + 1);
}
console.log(numbers)

1 Like

@cryptowriter.eth
The output of the above code will be:

[1, 2, 3, 4]

1 Like

output of the following code will be----[1,2,3,4]