Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
This Truthy and Falsy Values worksheet is part of the JavaScript Coding without HTML and CSS journey. Print it as a booklet?
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 10 | AWrong - the string "0" is actually truthy | |
| 2"hello" | B"" | |
| 3The empty string, always falsy | CWrong - an empty array is actually truthy | |
| 4An empty array, actually truthy | DA falsy value - treated as false in a boolean context | |
| 5"0" is treated as falsy in an if statement | EA truthy value - treated as true in a boolean context | |
| 6[] is treated as falsy in an if statement | F[] |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Falsy — A value that JavaScript treats as false in a boolean context, such as 0, "", null, undefined, or NaN.0 is a falsy value"" is a falsy value1 is a truthy valueAn empty string is a falsy valueAn array [] is a truthy value