var arr = [0,1,2,3,4]; console.log(SumofSq(arr)); function SumofSq(Arr) { sum = 0; for(var i =0; i< Arr.length ;i++) { sum =sum + Arr[i]*Arr[i]; } return sum; }
To embed this program on your website, copy the following code and paste it into your website's HTML: