function solution(dot) {
let [x, y] = dot
if (x > 0) return y > 0 ? 1 : 4
return y < 0 ? 3 : 2
}
function solution(dot) {
const [x, y] = dot;
if (y > 0) return x > 0 ? 1 : 2;
return x < 0 ? 3 : 4;
}
1) 구조분해할당
const [x, y] = dot;