mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 19:46:23 +00:00
18 lines
341 B
Markdown
18 lines
341 B
Markdown
|
---
|
||
|
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")
|
||
|
```
|