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);