LoginSignup
1
0

More than 5 years have passed since last update.

[Ruby]自己代入演算子

Posted at

勉強中に出てきた

自己代入演算子がややこしいのでメモっとく

hoge += 1 (hoge = hoge + 1の意味)
hoge -= 1 (hoge = hoge - 1の意味)
hoge *= 2 (hoge = hoge * 2の意味)
hoge /= 3 (hoge = hoge / 3の意味)

他にもあるらしいが、また勉強中に出てきたら書きたそう。

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