1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

記録を兼ねてアウトプットをしてみる

Posted at

TS/JS書いていて、これめっちゃ便利じゃん!と思った2つ!

1つ目
&& (論理 AND 演算子)
#【ふるまい】:
##左側が true の場合にのみ、右側を評価します。
#【具体例】:
##{value == 5 && value}
valueがtrue(valueが5)なら、右側を評価(valueを表示)する。

2つ目
boolean型を使った三項演算子
#【ふるまい】:
## 一番始めに条件となる関数とはてな記号(?)をおいて、trueなら2つ目の値、falseなら3つめの値をとる
#【具体例】:
##(editable ? "white" : "lightgray")
##editableという関数が、正しければwhiteという値を取る。間違いならLightgrayという値を取る。*これをスタイルシートに使えば関数を用いて切り替えができる!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?