var 12 var 99 console log for var length push Math pow for var in push

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
var a = [5, 12];
var b = [];
a[99] = 7;
console.log (a);
for(var i = 0; i <= a.length; i++){
b.push(Math.pow(a[i], 2));
}
for(var k in a){
b.push(Math.pow(a[k], 2));
}
console.log (b);