[英]Node.js: Async callback in _.chain underscore
The arr.length
is still undefined after I call _.chain()
underscore operation: 我调用
_.chain()
下划线操作后, arr.length
仍未定义:
var arr = _.chain(msg)
.groupBy(function(item) {return item.ts_simple; })
.value();
console.log(arr.length); //undefined
console.log(arr); //correct object array
The first console.log(arr.length)
for underscore var
array length is undefined
while the console.log(arr)
outputs the correct returned object array. 所述第一
console.log(arr.length)
为下划线var
阵列长度是undefined
,而console.log(arr)
输出正确的返回的对象阵列。
How do I callback after underscore operation is complete? 下划线操作完成后如何回调?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.