let arr = ['b', 3, 111, 'a', 1, 7, 'c']; arr.sort((a, b) => { if(typeof a === "string" && typeof a !== typeof b) { return -1; } else if (typeof b === "string" && typeof a !== typeof b) { return 1; } else { return a < b ? -1 : a === b ? 0 : 1; } }); //['a', 'b', 'c', 1, 3, 7, 111] - a와 b를 비교했을 때, a가 string, b가 number일 경우, 'return -1'을 하여 (a, b) 순으로 위치시킨다. : 'return -1'은 a를 ..