'cat' && 'dog' // 'dog'
두 개의 피연산자가 모두 true면 true 반환.
ex) 'cat'은 Truthy 값이므로 ture. 따라서 'dog'가 ture 값인지 확인하고 출력.
'cat' || 'dog' // 'cat'
두 개의 피연산자 중 하나라도 true면 true 반환.
ex) 'cat'은 Truthy 값이므로 true. 이미 true이기 때문에 'cat' 출력
var elem = null;
car value = elem?.value;
console.log(value); // null
옵셔널 체이닝은 좌항 피연산자가 null 혹은 undefined인 경우 undefined를 반환. 그렇지 않으면 우항의 프로퍼티 참조.
var test = null ?? 'default'
console.log(test); // 'default'
null 병합 연산자는 좌항의 피연산자가 null이나 undefined라면 우항의 프로퍼티. 참조