JavaScript easy to understand
javascript\n/**\n * @param {string[]} logs\n * @return {string[]}\n */\nvar reorderLogFiles = function(logs) {\n  const letterLogs = [];\n  const digitLogs = []
```javascript\n/**\n * @param {string[]} logs\n * @return {string[]}\n */\nvar reorderLogFiles = function(logs) {\n  const letterLogs = [];\n  const digitLogs = [];\n  logs.forEach(log => {\n    if (/ \\d/.test(log)) {\n      digitLogs.push(log);\n    } else {\n      letterLogs.push(log);\n    }\n  });\n  letterLogs.sort((a, b) => {\n    const aBody = a.slice(a.indexOf(\' \') + 1);\n    const bBody = b.slice(b.indexOf(\' \') + 1);\n    const c = aBody.localeCompare(bBody);\n    if (c) return c;\n    return a.localeCompare(b);\n  });\n  return [...letterLogs, ...digitLogs];\n};\n```\n\n* 63/63 cases passed (52 ms)\n* Your runtime beats 99.24 % of javascript submissions\n* Your memory usage beats 71.43 % of javascript submissions (37.2 MB)
['JavaScript']