JS Wie man das Array nach Stringlänge sortiert

(() => {
  let arr = ["HTML", "Go", "Ruby", "Python", "JavaScript", "CSS"];
  function sortByLength(arr) {
    return arr.sort((a, b) => a.length - b.length);
  }

  console.log(sortByLength(arr)); // => [ 'Go', 'CSS', 'HTML', 'Ruby', 'Python', 'JavaScript' ]
})();
Condemned Corncrake