JSFiddle - React, Tailwind, and code Playground

by karthick6891

HTML

basic sort

JavaScript

var arr = ["xyz","abc", "bba","dde", "4' x 8' x 16' (Dragline Mat)", "Construction Crew - Tie-Ins"]

console.log(arr.sort(comparator))

function comparator(a,b) {
	a = a.toLowerCase();
  b = b.toLowerCase();
  return a.localeCompare(b, 'en', { numeric: true });
}