condition ? expr1 : expr2
console.log(true ? "참" : "거짓") // 참
console.log(false ? "참" : "거짓") // 거짓
console.log(1 === 1 ? "참" : "거짓") // 참
console.log(1 !== 1 ? "참" : "거짓") // 거짓
'Javascript' 카테고리의 다른 글
단축 속성명 (property shorthand) (0) | 2023.07.26 |
---|---|
구조 분해 할당 (De + structuring) (0) | 2023.07.26 |
화살표 함수 (Arrow Function) (0) | 2023.07.26 |
let & const (0) | 2023.07.26 |
break문과 continue문 (0) | 2023.07.26 |