Answers for "sort by string react"

0

sort by string react

const myData = this.state.contacts
 .sort((a, b) => a.name.localeCompare(b.name))
 .map((item, i) => <List key={i} data={item} />);
Never look this up again
Posted by: Guest on February-23-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language