JSFiddle - React, Tailwind, and code Playground
JavaScript
var input = ["ap1", "ap4", "ap12","4ggh2","7ggh9","9tggfg2","4gghdd2","4gghfg2"];
input.sort();
alert(input);
var input = ["ap1", "ap4", "ap12","4ggh2","7ggh9","9tggfg2","4gghdd2","4gghfg2"];
input.sort();
alert(input);