Lodash is a JavaScript library that helps programmers deal with all types of object.
- Angular: 7.0.3
- Node: 8.10.0
- Typescript: 3.1.6
$ npm install --save lodash
$ npm install --save-dev @types/lodash
import * as _ from 'lodash'
Usage
updateData(newItem: any){
let index = _.findIndex(this.data, {id: newItem.id});
...
}
import { findIndex } from 'lodash'
Usage
updateData(newItem: any){
let index = findIndex(this.data, {id: newItem.id});
...
}