const sort = (str) => str .split('') .sort((a, b) => a.localeCompare(b)) .join('');
const sort = (str: string): string => str .split('') .sort((a, b) => a.localeCompare(b)) .join('');
sort('hello world'); // dehllloorw