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

Get first entry from ilists (default order).

Similar: head, tail.


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

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

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


References

Clone this wiki locally