修正・追加
Ruby
irb(main):002:0> hoge ||= 'fuga' => "fuga" irb(main):003:0> hoge => "fuga"
Javascript
1
> var hoge; undefined > hoge = hoge || 'fuga'; "fuga" > hoge "fuga"
2
> var hoge; undefined > hoge || (hoge = 'fuga'); "fuga" > hoge "fuga"
Python
>>> hoge = None >>> hoge = hoge or 'fuga' >>> hoge 'fuga'