showing results for - "javascript operator double pipes"
Lorenzo
12 Oct 2018
1// Returns the right-hand operand if the left-hand is 0, false, empty string{, null, undefined or NaN
20 || "other" // "other"
3false || "other" // "other"
4"" || "other" // "other"
5null || "other" // "other"
6undefined || "other" // "other"
7NaN || "other" // "other"
8
9({}) || "other" // {}
10[] || "other" // []