works
This commit is contained in:
parent
0ef7054ccf
commit
3dc3018fd1
98 changed files with 1182 additions and 198 deletions
12
1-js/2-first-steps/13-ifelse/1-if-zero-string/solution.md
Normal file
12
1-js/2-first-steps/13-ifelse/1-if-zero-string/solution.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
**Yes, it will.**
|
||||
|
||||
Any string except an empty one (and `"0"` is not empty) becomes `true` in the logical context.
|
||||
|
||||
We can run and check:
|
||||
|
||||
```js run
|
||||
if ("0") {
|
||||
alert( 'Hello' );
|
||||
}
|
||||
```
|
||||
|
14
1-js/2-first-steps/13-ifelse/1-if-zero-string/task.md
Normal file
14
1-js/2-first-steps/13-ifelse/1-if-zero-string/task.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
importance: 5
|
||||
|
||||
---
|
||||
|
||||
# if (a string with zero)
|
||||
|
||||
Will `alert` be shown?
|
||||
|
||||
```js
|
||||
if ("0") {
|
||||
alert( 'Hello' );
|
||||
}
|
||||
```
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue