Lodash - 惰性函式



語法

_.noop()

此方法返回未定義。

示例

var _ = require('lodash');

console.log(_.times(2, _.noop));

將上述程式儲存到 tester.js 中。執行以下命令來執行此程式。

命令

\>node tester.js

輸出

[ undefined, undefined ]
lodash_util.htm
廣告
© . All rights reserved.