+ 1
What is the meaning of sign || in javascript?
2 Réponses
+ 2
The sign "||" means OR.
Similiar to AND "&&".
Example:
if (a || b) {
// code
}
This code will run if a or b are true.
+ 2
It's a sign for *OR*
It is used when you want atleast 1 condition as true to run the program
a=1
b=2
a==1||b==1
If you set this condition then your program will be executed because one of the two conditions is true