我使用lodash
NPM
时遇到问题。
我的代码:
var _ = require('lodash');
console.log(_.chunk(['1','2','3','4'], 3));
回复:_.chunk is not a function
Lodash版本:latest : 4.17.4
答案 0 :(得分:1)
您所包含的示例在语法上是正确的。我建议您确保已正确安装该软件包。
$ npm i -g npm
$ npm i --save lodash