how to use lodash on frontend

Viewed 39

I try to use lodash chaining with a simple example like this in nuxtJS

import _chain from 'lodash/chain'

const b = _chain([1,2,3,4]).map((i) => i + 1).value()

and receive this error

index.mjs?9a99:291 Error in fetch(): TypeError: lodash_chain__WEBPACK_IMPORTED_MODULE_7___default(...)(...).map is not a function

I cannot use

import _ from 'lodash'

What is the proper way to use lodash chaining?

0 Answers
Related