-
Notifications
You must be signed in to change notification settings - Fork 0
head
Subhajit Sahu edited this page Dec 22, 2022
·
14 revisions
Get first value.
function head(x, vd?)
// x: an iterable
// vd: default value
const entries = require('extra-entries');
var x = [["a", 1], ["b", 2], ["c", 3]];
entries.head(x);
// → [ "a", 1 ]
var x = [];
entries.head(x, ["", -1]);
// → [ "", -1 ]