Using The String localeCompare() Method To Implement A Natural Sort In Angular 8.2.0-next.0

added by JavaScript Kicks
7/11/2019 12:40:26 PM

267 Views

Ben Nadel demonstrates how the String.prototype.localeCompare() method can be used, in modern browsers, to implement a "natural sort" with almost no effort. This type of sort treats embedded numbers as numbers, leading to a more human-friendly ordering of string values.


0 comments