wiki/content/20201112105833-javascript_short_circuiting_of_logical_operators.md

19 lines
358 B
Markdown
Raw Permalink Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-30 17:34:11 +00:00
date: 2020-11-12
2024-05-06 20:40:05 +00:00
id: 2e3bb381-730b-416b-bd83-b99510244927
title: JavaScript Short Circuiting of Logical Operators
---
# Syntax
``` javascript
console.log(null || "user")
console.log("Agnes" || "user")
console.log(0 || -1)
console.log("" || "!?")
console.log(true || "X")
console.log(false || "X")
console.log(true && "X")
console.log(false && "X")
```