Created
December 10, 2020 07:12
-
-
Save vuongddang/7286fe843fd518c450f0199cea3b0a20 to your computer and use it in GitHub Desktop.
Import and use a particular lodash function in react component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { maxBy } from 'lodash' | |
const items = [ | |
{ name: 'A', price: 1 }, | |
{ name: 'B', price: 2 } | |
] | |
maxBy(items, 'price') | |
// => {name: 'B', price: 2} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment