Warmup
Warmup
Predict the output of the following code:
function abc(arr){
for(var i = 0; i < arr.length; i++){
arr[i] = i + 1;
}
console.log(arr);
}
abc([18,12,14,1,5]);
function abc(arr){
for(var i = 0; i < arr.length; i++){
arr[i] = i + 1;
}
console.log(arr);
}
abc([18,12,14,1,5]);
Choose the correct answer:
-
[19,13,15,2,7]
-
[0,1,2,3,4,5]
-
[17,11,13,0,4]
-
[1,2,3,4,5]
* Failure in every first attempt will result in a deduction on your total points.