Skip to content
Subhajit Sahu edited this page Dec 5, 2022 · 16 revisions

Get first entry from map (default order).

Similar: head, tail.


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

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

var x = new Map();
map.head(x);
// → []


References

Clone this wiki locally