0
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?

More than 1 year has passed since last update.

投稿 134 三項演算子 2024/11/11

0
Posted at

本日の勉強時間 3H

三項演算子は、条件分岐を1行で書くための短い構文です。if文を使うほど複雑ではないけれど、条件によって異なる値や処理を使いたいときに便利です。

基本の構文
三項演算子の基本構文は次のとおりです。

条件式 ? 真のときの値 : 偽のときの値
0
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
0
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?