Skip to content

Commit 7959adf

Browse files
committed
minor fixes
1 parent 8831603 commit 7959adf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

1-js/02-first-steps/15-function-basics/article.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ On the other hand, it's independently called every time when `text` is missing.
226226
```
227227

228228
````smart header="Default parameters in old JavaScript code"
229-
Several years ago, JavaScript didn't support the syntax for default parameters.
229+
Several years ago, JavaScript didn't support the syntax for default parameters. So people used other ways to specify them.
230230

231-
So people used other ways to specify them. Nowadays, we can mostly come across them in old scripts.
231+
Nowadays, we can come across them in old scripts.
232232

233233
For example, an explicit check for `undefined`:
234234

@@ -249,6 +249,7 @@ function showMessage(from, text) {
249249
```js
250250
function showMessage(from, text) {
251251
// If the value of text is falsy, assign the default value
252+
// this assumes that text == "" is the same as no text at all
252253
text = text || 'no text given';
253254
...
254255
}

0 commit comments

Comments
 (0)