JavaScript Solution, Sort(), straight forward
The key is to understand what the question it is.\n\njavascript\nfunction compare(a, b) {\n    let i = a.indexOf(\' \');\n    const at = a.substring(i + 1);\n  
The key is to understand what the question it is.\n\n```javascript\nfunction compare(a, b) {\n    let i = a.indexOf(\' \');\n    const at = a.substring(i + 1);\n    i = b.indexOf(\' \');\n    const bt = b.substring(i + 1);\n    return at.localeCompare(bt);\n}\n\nvar reorderLogFiles = function(logs) {\n    const letterLogs = [];\n    const digitLogs = [];\n    for (const l of logs) {\n        const charCode = l.charCodeAt(l.length - 1);\n        if (charCode <= 57 && charCode >= 48) {\n            digitLogs.push(l);\n        } else {\n            letterLogs.push(l);\n        }\n    }\n    letterLogs.sort(compare); \n    return [...letterLogs, ...digitLogs];\n};\n```
[]