Easy JS Solution
\n/**\n * @param {string[]} logs\n * @return {string[]}\n */\nvar reorderLogFiles = function(logs) {\n    let digitLogs = [], wordLogs = [];\n    for (let log o
```\n/**\n * @param {string[]} logs\n * @return {string[]}\n */\nvar reorderLogFiles = function(logs) {\n    let digitLogs = [], wordLogs = [];\n    for (let log of logs) {\n        let arr = log.split(" ");\n        if (isNaN(arr[1])) wordLogs.push({id: arr.slice(0,1), body: arr.slice(1).join(" ")});\n        else digitLogs.push(log);\n    }\n    wordLogs.sort((log1,log2) => {\n        if (log1.body < log2.body) return -1;\n        if (log1.body > log2.body) return 1;\n        if (log1.id < log2.id) return -1;\n        if (log1.id > log2.id) return 1;\n    })\n    let sortedWordLogs = wordLogs.map(log => `${log.id} ${log.body}`);\n    return sortedWordLogs.concat(digitLogs);\n};\n```
['JavaScript']