wiki/content/20201112110025-javascript_conditional_ternary_operator.md

13 lines
198 B
Markdown
Raw Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-29 18:27:12 +00:00
date: 2020-11-12
2024-05-06 20:40:05 +00:00
id: 4a8846d3-a3c3-4edc-8fa1-a2de76f1094f
title: JavaScript Conditional (Ternary) Operator
---
# Syntax
``` javascript
console.log(true ? 1 : 2)
console.log(false ? 1 : 2)
```