...
Spread 연산자와 단락회로평가를 이용해 Object Literal에 조건부로 필드 넣기
Conditionally Adding Fields In Object Literal With Spread Operator And Short Circuit Evaluation
동료와 메신저에서 얘기가 나와서, 이래 저래 정리해봄.
const result = { ... !true && { notTrueAnd: 1 }, ... !false && { notFalseAnd: 2 }, ... true || { TrueOr: 3 }, ... false || { FalseOr: 4 }, }; result; // { notFalseAnd: 2, FalseOr: 4 }
const True = true; const False = false; const result = { ... !True && { notTrueAnd: 1 }, ... !False && { notFalseAnd: 2 }, ... True || { TrueOr: 3 }, ... False || { FalseOr: 4 }, }; result; // { notFalseAnd: 2, FalseOr: 4 }
내취향은 아님.
It's so tricky and not my favor.
2.1. Backlinks2.2. Similar PagesSimilar pages by cosine similarity. Words after page name are term frequency.
|