Skip to content

Commit b54f7b6

Browse files
committed
added third example utilizing Boolean functions and null values.
1 parent efc3ffe commit b54f7b6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

explicit-and-implicit-conversion-in-javascript.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,11 @@ let day = String(14);
4949
let year = String(2025);
5050
let fullDate = month + "/" + day + "/" + year;
5151
console.log(`Pi Day is ${fullDate} and also STL Day!`);
52-
//I utilized the String() function to explicity convert the numbers for the month, day, and year to strings before inputing the data into the fullDate variable.
52+
//I utilized the String() function to explicity convert the numbers for the month, day, and year to strings before inputing the data into the fullDate variable.
53+
54+
let answer = Boolean(null);
55+
if (answer) {
56+
console.log("This is correct!");
57+
}
58+
console.log(answer);
59+
//I used a boolean expression to convert an null value into a boolean value

0 commit comments

Comments
 (0)