wiki/content/20201112105833-javascript_short_circuiting_of_logical_operators.md

19 lines
356 B
Markdown
Raw Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-30 17:04:36 +00:00
date: 20201112
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")
```