Help us understand the problem. What is going on with this article?

if文をワンライナーで書く

More than 1 year has passed since last update.

ちょっとしたif文を一文で書きたいときの備忘録

元の文

- if hoge?
 AAA
- else
 BBB

一行で書いたもの

- hoge? ? AAA : BBB

短くなりました :tada:

titaniumkun
都内在住デザイナー。RailsやNuxtなどフロント周りの技術的な備忘録など。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away