Skip to content

Commit f633d1e

Browse files
author
Rebecca Murphey
committed
cleanup
1 parent c476ce6 commit f633d1e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

content/javascript-101/operators.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,13 @@ details on which values evaluate to true and which evaluate to false.
9898
You'll sometimes see developers use these logical operators for flow control
9999
instead of using if statements. For example:
100100

101-
<div class="example" markdown="1">
102-
// do something with foo if foo is truthy
103-
foo && doSomething(foo);
101+
// do something with foo if foo is truthy
102+
foo && doSomething(foo);
104103

105-
// set bar to baz if baz is truthy;
106-
// otherwise, set it to the return
107-
// value of createBar()
108-
var bar = baz || createBar();
109-
</div>
104+
// set bar to baz if baz is truthy;
105+
// otherwise, set it to the return
106+
// value of createBar()
107+
var bar = baz || createBar();
110108

111109
This style is quite elegant and pleasantly terse; that said, it can be really
112110
hard to read, especially for beginners. I bring it up here so you'll recognize

0 commit comments

Comments
 (0)