Back to the lesson

What's the result of OR?

importance: 5

What the code below is going to output?

alert( null || 2 || undefined );

The answer is 2, that’s the first truthy value.

alert( null || 2 || undefined );