-
Notifications
You must be signed in to change notification settings - Fork 0
reduce
Subhajit Sahu edited this page Feb 4, 2021
·
14 revisions
Reduces values to a single value. 📦 😺 🏃 📼 🌔 📜 📰 📘
entries.reduce(x, fr, [acc]);
// x: entries
// fr: reduce function (acc, v, k, x)
// acc: initial value
const entries = require("extra-entries");
var x = [["a", 1], ["b", 2], ["c", 3], ["d", 4]];
entries.reduce(x, (acc, v) => acc+v);
// 10
entries.reduce(x, (acc, v) => acc+v, 100);
// 110