Skip to content
Subhajit Sahu edited this page Dec 28, 2022 · 14 revisions

Get first entry from lists (default order).

Similar: head, tail.


function head(x, ed)
// x:  lists
// ed: default entry
const xlists = require('extra-lists');

var x = [['a', 'b', 'c'], [1, 2, 3]];
xlists.head(x);
// → [ 'a', 1 ]

var x = [[], []];
xlists.head(x, ['', -1]);
// → [ '', -1 ]


References

Clone this wiki locally