Lodash教程

Lodash prototype[Symbol.iterator] method

语法

_.prototype[Symbol.iterator]()
Enables the wrapper to be iterable.

输出

(Object) − Returns the wrapper object.

实例

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

Command

\>node tester.js

输出

true
true
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4