You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
navigator.lua/playground/js/curry.js

12 lines
233 B
JavaScript

function curriedDot(vector1) {
return function(vector2) {
return vector1.reduce(
(sum, element, index) => (sum += element * vector2[index]),
0
);
};
}
const sumElements = curriedDot([1, 1, 1]);
console.log()