Advertisement
BillGilbert

Untitled

May 20th, 2022
684
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export function sortStrings(arr, param = `asc`) {
  2.   return [...arr].sort((x, y) => {
  3.     const c = x.localeCompare(y, "ru", { caseFirst: "upper" });
  4.  
  5.     return param === "desc" ? -c : c;
  6.   });
  7. }
Advertisement
RAW Paste Data Copied
Advertisement