minor fixes
This commit is contained in:
parent
ff042a0319
commit
e85e48f8d0
4 changed files with 5 additions and 5 deletions
|
@ -256,7 +256,7 @@ For even values of `i`, the `continue` directive stops executing the body and pa
|
|||
````smart header="The `continue` directive helps decrease nesting"
|
||||
A loop that shows odd values could look like this:
|
||||
|
||||
```js
|
||||
```js run
|
||||
for (let i = 0; i < 10; i++) {
|
||||
|
||||
if (i % 2) {
|
||||
|
@ -268,7 +268,7 @@ for (let i = 0; i < 10; i++) {
|
|||
|
||||
From a technical point of view, this is identical to the example above. Surely, we can just wrap the code in an `if` block instead of using `continue`.
|
||||
|
||||
But as a side-effect, this created one more level of nesting (the `alert` call inside the curly braces). If the code inside of`if` is longer than a few lines, that may decrease the overall readability.
|
||||
But as a side-effect, this created one more level of nesting (the `alert` call inside the curly braces). If the code inside of `if` is longer than a few lines, that may decrease the overall readability.
|
||||
````
|
||||
|
||||
````warn header="No `break/continue` to the right side of '?'"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue