Add nullish coalescing to multiple articles, refactor operators, renumber the chapter
This commit is contained in:
parent
175aefa0b8
commit
8a13c992d6
54 changed files with 386 additions and 183 deletions
18
1-js/02-first-steps/08-operators/4-fix-prompt/task.md
Normal file
18
1-js/02-first-steps/08-operators/4-fix-prompt/task.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
importance: 5
|
||||
|
||||
---
|
||||
|
||||
# Fix the addition
|
||||
|
||||
Here's a code that asks the user for two numbers and shows their sum.
|
||||
|
||||
It works incorrectly. The output in the example below is `12` (for default prompt values).
|
||||
|
||||
Why? Fix it. The result should be `3`.
|
||||
|
||||
```js run
|
||||
let a = prompt("First number?", 1);
|
||||
let b = prompt("Second number?", 2);
|
||||
|
||||
alert(a + b); // 12
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue