JSFiddle - React, Tailwind, and code Playground
by AlexGun
JavaScript
//Написать функцию, которая возвращает сумму квадратов массива
// [1, 2, 2] → 9 (1^2 + 2^2 + 2^2 = 9)
// [0, 3, 4, 5] → 50
function sumSquare(arr) {
return arr.map(item => item*item).reduce((acc,cur) => acc + cur)
}