Typescript: sort array of objects by property value
sorting alphabetically

How to sort array containing list of object by object property value? For example, we have a list of user object and we want to sort it by user name:and now we want to sort this list by user firstname - we will use method sort():and now we have array sorted alphabetically by object property: firstname.And now our user array will look like this:so, the full typescript code for sorting array of object by object property value will look like this:

  • Photo
  • JavaScript
  • TypeScript
  • Sort