JSFiddle - React, Tailwind, and code Playground

by Vladymyr Shevchuk

JavaScript

const arr = ["Детский велосипед Lexus Trike Racer Trike", "Детский велосипед Lexus Trike Grand"];

const direction = 1;

const result = [...arr].sort((a, b) => {
  return direction * a.localeCompare(b, 'ru');
});

console.log(result);