반응형
그냥 이렇게 쓰면 됨, ``내부에 또 ``넣는 건 안되는듯
json.data[0].word
? `${json.data[0].word} (${json.data[0].reading})`
: `${json.data[0].reading}`
반응형
'js > js syntax' 카테고리의 다른 글
1->01: (1+'').padStart(2,'0'), (1).toLocaleString('en-US',{minimumIntegerDigits:2}) (0) | 2024.01.31 |
---|---|
javascript true/false (0) | 2022.08.31 |
js reduce function (0) | 2022.08.22 |
js empty array check: arr?.length===0 (객체이면 arr.length는 undefined) (0) | 2022.07.11 |
Javascript Array Function - Map (0) | 2019.10.24 |