I'm trying to sort an array of objects in JS, but it doesn't work for some reason. The array I requested from API may contain numbers, upper and lower case letters, and some Chinese characters.
eg:
const arr = [
{ "title": "!Test Segment and CSV" },
{ "title": "&test (SC)" },
{ "title": "1234test (SC)" },
{ "title": "AAShop1 (SC)" },
{ "title": "AAShop2(SC)" },
{ "title": "ABCshop123 (SC)" },
{ "title": "adidas Outlet" },
{ "title": "AIGLE" },
{ "title": "American Eagle" },
{ "title": "Châteraisé" },
{ "title": "Tekcent" },
{ "title": "반찬 & COOK" },
{ "title": "始祖鸟" },
{ "title": "春水堂" },
{ "title": "稻成" }
];
I want it sorted according to the following rules.
sort a after A
sort B after A
sort Ac after ABC
{ "title": "!Test Segment and CSV" }, { "title": "&test (SC)" }, { "title": "1234test (SC)" }, { "title": "AAShop1 (SC)" }, { "title": "AAShop2(SC)" }, { "title": "ABCshop123 (SC)" }, { "title": "AIGLE" }, { "title": "American Eagle" }, { "title": "adidas Outlet" }, { "title": "Châteraisé" }, { "title": "Tekcent" }, { "title": "始祖鸟" }, { "title": "春水堂" }, { "title": "稻成" }, { "title": "반찬 & COOK" }
Thanks in advance for any help!