【发布时间】:2015-02-04 08:39:24
【问题描述】:
我是 node.js-lodash 的新手。目前我想使用这个库的findKey()-function。不幸的是,我收到类型错误。出了什么问题?
var objCol = {
'objA' : { 'myattrA' : 'myval1', 'myattrB' : 'myval2' },
'objB' : { 'myattrA' : 'myval3', 'myattrB' : 'myval4' }
};
var obj = _.findKey(objCol, {'myattrA' : 'myval3'});
console.log(obj);
Eclipse Enide中对应的错误信息为:
MessageBuilder:在事件处理程序中检测到错误[39m [TypeError:
对象函数 (obj) { if (obj instanceof _) return obj;
if (!(this instanceof _)) return new _(obj);
this._wrapped = obj; } 没有方法 'findKey'] TypeError: Object 函数 (obj) {
if (obj instanceof _) return obj;
if (!(this instanceof _)) return new _(obj);
this._wrapped = obj; } 没有方法'findKey'
【问题讨论】:
-
确定
_变量中有lodash?
标签: javascript node.js lodash