【发布时间】:2017-10-26 21:04:55
【问题描述】:
下面values是file-2.js中的普通对象吗?
// file-1.js
export {
FOO,
BAR
} from '~/my-values';
// file-2.js
import * as values from '~/file-1';
// what is `values` here? an object instance?
我问是因为我想使用values.hasOwnProperty('FOO') 之类的东西,并且汇总引发了以下错误:
'hasOwnProperty' is not exported by 'file-1.js'
附带问题:有没有使用 import 和 export 关键字测试代码的便捷方法?据我所知,Chrome 开发工具在 sn-ps 中不支持它们。
【问题讨论】: