目录
当前位置: 首页 > 文档资料 > Lazy.js 英文文档 >

last

优质
小牛编辑
136浏览
2023-12-01

An optimized version of Sequence#last that returns another StringLikeSequence (or just the last character, if count is undefined).

Examples

Lazy('foo').last()                // => 'o'
Lazy('foo').last(2)               // sequence: 'oo'
Lazy('foo').last(10)              // sequence: 'foo'
Lazy('foo').toUpperCase().last()  // => 'O'
Lazy('foo').toUpperCase().last(2) // sequence: 'OO'