Top "Or-operator" questions

The OR operator may represent the "logical boolean or" operation || or a "bitwise or" operation |. Use [sql] for questions related to the SQL "OR" keyword, and [regex-alternation] for the use of alternation construct |. Do NOT use this tag for questions only specific to [bitwise-or] operations.

JavaScript OR (||) variable assignment explanation

Given this snippet of JavaScript... var a; var b = null; var c = undefined; var d = 4; var e = 'five'; var f = …

javascript variables variable-assignment or-operator
Boolean operators && and ||

According to the R language definition, the difference between & and && (correspondingly | and ||) is that the former is …

r logical-operators boolean-operations or-operator and-operator
Logical Operators, || or OR?

I remember reading a while back in regards to logical operators that in the case of OR, using || was better …

php operators logical-operators or-operator
What does the construct x = x || y mean?

I am debugging some JavaScript, and can't explain what this || does? function (title, msg) { var title = title || 'Error'; var msg = …

javascript parameters optional-parameters or-operator
Shortcut "or-assignment" (|=) operator in Java

I have a long set of comparisons to do in Java, and I'd like to know if one or more …

java assignment-operator compound-assignment or-operator
PHP "or" Syntax

I've seen this a lot: $fp = fopen($filepath, "w") or die(); But I can't seem to find any real documentation …

php syntax program-flow control-structure or-operator
Switch statement using or

I'm creating a console app and using a switch statement to create a simple menu system. User input is in …

c++ switch-statement conditional-statements or-operator
Angular 2 ngSwitchCase, OR operator not working

I have multiple switch statement but for some case i need the common case. So, i am trying the OR …

angular switch-statement ng-switch or-operator
Switch case with logical operator in C

I am new to C and need help. My code is the following. #include<stdio.h> #include<…

c switch-statement or-operator
What does "var FOO = FOO || {}" (assign a variable or an empty object to that variable) mean in Javascript?

Looking at an online source code I came across this at the top of several source files. var FOO = FOO || {}; …

javascript namespaces variable-declaration or-operator