Lodash教程

Lodash prototype.next method

语法

_.prototype.next()
Gets the next value on a wrapped object following the iterator protocol.

输出

(Object) − Returns the next iterator value.

实例

var _ = require('lodash');  
var wrapped = _([1, 2]);
 
console.log(wrapped.next());
console.log(wrapped.next());
Save the above program in tester.js. Run the following command to execute this program.

Command

\>node tester.js

输出

{ done: false, value: 1 }
{ done: false, value: 2 }
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4