I have a node file that exports an object
(path './../../config/cloud.js):
module.exports = {
some: {
property: 1
}
}
if I use the following code:
const config = require('./../../config/cloud');
const _ = require('lodash');
console.log(_.get(config, 'some.property'); // prints undefined
console.log(config.some.property); // print 1
Can you help me to see what I'm doing wrong? Thanks
EDIT: I expect that the first console.log
prints 1
instead of undefined
.
由于某种原因, _
是未定义的,并引发了某种异常,该异常在某种程度上在我的日志中不可见。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.