Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Using The Or (||) Operator To Set A Variable

DZone's Guide to

Using The Or (||) Operator To Set A Variable

· ·
Free Resource

a = nil
b = nil
d = a || b || 'success'
puts d
#=> success
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}