process = (funcs, initialArg) => funcs.reduce((arg, f) => f(arg), initialArg);
console.log(process([ (a) => a + 1, (a) => a * 2 ], 5));
function solve(arr) {
const unique = [];
for (let i = arr.length; i--;) {
if (unique.includes(arr[i])) {
arr.splice(i, 1);
} else {
unique.push(arr[i]);
}
}
return arr;
}
(acc[n.storey] ??= []).push(n)
на (acc[n.storey] = acc[n.storey] || []).push(n)
?