Easy to read JavaScript solution
\n/**\n * @param {string[]} logs\n * @return {string[]}\n */\nvar reorderLogFiles = function(logs) {\n  return [\n\t...logs.filter(isLetterLog).sort(sortByLette
```\n/**\n * @param {string[]} logs\n * @return {string[]}\n */\nvar reorderLogFiles = function(logs) {\n  return [\n\t...logs.filter(isLetterLog).sort(sortByLetters),\n\t...logs.filter(isDigit)\n  ]\n};\n\nfunction sortByLetters(log1, log2) {\n  const [id1, ...letters1] = log1.split(\' \');\n  const [id2, ...letters2] = log2.split(\' \');\n  const diff = letters1.join(\' \').localeCompare(letters2.join(\' \'));\n  return diff === 0 ? id1.localeCompare(id2) : diff;\n}\n\nfunction isLetterLog(log) {\n  const [_, letter] = log.split(\' \');\n  return isNaN(Number(letter));\n}\n\nfunction isDigit(log) {\n  return !isLetterLog(log)\n}```
['Recursion', 'JavaScript']