Lodash - prototype.next method



Syntax

_.prototype.next()

Gets the next value on a wrapped object following the iterator protocol.

Output

  • (Object) − Returns the next iterator value.

Example

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

Output

{ done: false, value: 1 }
{ done: false, value: 2 }
lodash_seq.htm
Advertisements