|| o ruby

Esempi di codice

0
0

||= ruby

a ||= nil
a ||= 0
a ||= 2
# a returns 0
# ||= conditional assignment if a is unassigned then it gets assigned
# otherwise it remains with the value it has as per 2 and 3 lines
0
0

ruby e o

you can use equivalenty
&& in place of and (and viceversa)
|| in place of or

In altre lingue

Questa pagina è in altre lingue

Русский
..................................................................................................................
English
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................