We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 696e2c6 commit c3186fcCopy full SHA for c3186fc
29_ternary_operator.js
@@ -0,0 +1,18 @@
1
+// ternary operator
2
+// condition ? (runs if true) : (runs if false)
3
+
4
+const values = 10 > 5;
5
6
+//values ? is condition
7
+values
8
+ ? console.log('10 bigger than five')
9
+ : console.log('print if this false');
10
11
+// // example use if else
12
+// const values = 10 > 5;
13
+// if (values) {
14
+// console.log('10 bigger than five');
15
+// } else {
16
+// console.log('false statement');
17
+// }
18
+// // output: 10 bigger than five
0 commit comments