var arr = [0,1,4,9,16]; var arr1 = []; for(var i = 0; i < arr.length; i++) { arr1.push(arr[i] * arr[i]); }; console.log(arr1);
var length = 100, array = new Array(length); while(length--){ array[length] = Math.pow(length, 2); //или length * length; } console.log(array);