almost 8 years ago
Ruby supports both && as well as and.
The basic difference between these 2 lies in their precedence order.
&& has higher preference than and.
and has lower preference than = unlike && which has higher preference than =
The major difference comes while evaluating the boolean expressions.
as we know = has higher preference than and, so while evaluating the below statement a is assigned as true
>> a = true and false
>> puts a
Now as && has higher preference than =, so firstly the expression is evaluated and then it assigned to a, thus a is set as false
>> a = true && false
>> puts a
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Terms of Service
| © copyright 2023 FindNerd.com. All rights reserved.
Sign up using