我的快速路由器中有这样的咖啡代码:
myObj = {}
files = [file1,file2]
files.forEach (file) ->
# do stuff to fill up myObj with more data
return myObj
res.status(202).send
status: 'OK'
payload: myObj
return
现在如何将myObj从forEach循环传递到我的代码的http响应部分?
这就是我所看到的:
ReferenceError: myObj is not defined
at server/api/parse/parse.controller.js:494:14
at Object.oncomplete (fs.js:107:15)