Adonis has collection like Laravel Collection

We want some array operations like merged, find by key, value, groupBy

1 Like

Hey @ashishnimrot! :wave:

Use a library like lodash or collectjs.


Yea, lodash is fantastic… and you can even restrict what you load to only specific modules, so instead of loading all of lodash, you could load just it’s take module, for example.

const _take = use('lodash/take')
// or
const _ = use('lodash')

// then
// is the same as

That’s usually more an issue for client-side stuff, but worth knowing that you can load just explicit pieces of lodash. :slight_smile: