javascript
\nvar reorderLogFiles = function(logs) {\n    let letter = [], digit = [];\n    for(let v of logs) {\n        if(v.split(" ")[1].charAt(0) >= \'0\' && v.split("
```\nvar reorderLogFiles = function(logs) {\n    let letter = [], digit = [];\n    for(let v of logs) {\n        if(v.split(" ")[1].charAt(0) >= \'0\' && v.split(" ")[1].charAt(0) <= \'9\'){\n            digit.push(v);\n        } else {\n            letter.push(v);\n        }\n    }\n    letter.sort(function (a, b) {\n        return a.split(" ")[1].localeCompare(b.split(" ")[1]) || a.split(" ")[2].localeCompare(b.split(" ")[2])\n    })\n    return letter.concat(digit);\n};\n```
[]