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 3 years have passed since last update.

if の条件式とは(超基礎)

Posted at

わかっているつもりであいまいだった基礎なので言語化しました。

条件によって処理を分けるためにifを使用する。
(使用方法:条件式にifを渡す)

ifは基本的に「trueかfalseかを判断するもの」
trueであれば、if直下の処理が実行!
falseであれば実行されない。

.ruby
if true # trueという値そのもの
  puts "出力" # 実行される
end
if false # falseという値そのもの
  puts "出力" # 実行されない
end
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?