if (false) {
console.log('The code in this block will not run.');
} else {
console.log('But the code in this block will!');
}
// Prints: But the code in this block will!
()
안에 연산식을 넣는다.
if문에서 false 값을 넣으면 입력값은 실행되지 않고 else값이 실행된다.
(true일 때 if값이 실행됨)
조건 ? value1 : value 2;
조건이 true이면 ? 다음을 실행, 그게 아니면 : 다음을 실행
간단하게 출력 등이 필요할 때 사용