Skip to content
Subhajit Sahu edited this page Feb 3, 2021 · 19 revisions

Get last value.

Similar: head, tail, init, last.


function last(x, vd?)
// x:  an iterable
// vd: default value
const xiterable = require('extra-iterable');

xiterable.last([1, 2, 3]);
// → 3

xiterable.last([], -1);
// → -1


References

Clone this wiki locally