我需要在 JSBin 中展示一个使用 Lodash 的代码,但无法弄清如何进行“get”导入。我收到了错误信息"ReferenceError: require is not defined
。
https://jsbin.com/hotobir/edit?js,console
// Normally that is working fine
import { get } from 'lodash'
//No import get from 'lodash/get'
//No const { get } = lodash
const obj = { myKey: 'myValue' }
console.log(get(obj, 'myKey', 'notThere'))
如何进行导入?