Skip to content

Commit eb89d49

Browse files
committed
modified my answer for the Boolean problem
1 parent 49c62c5 commit eb89d49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ Use console.log() to clearly show the before-and-after type conversions.
2222
let result = Number("5") - 2; //this looked correct to me and displayed how I expected. I added Number() to be more clear
2323
console.log("The result is: " + result);
2424

25-
let isValid = Boolean("false" == false);//I added '==' so that the string 'false' will be equal to the boolean false.
25+
let isValid = Boolean("false"); //originally fixed at (let isValid = Boolean ("false"==false));)
2626
if (isValid) {
2727
console.log("This is valid!");
2828
}
29-
29+
//After reading more about Boolean(), this is a "truthy" and that as long as there is something in the value of the Boolean() other than edge case.
3030

3131
let age = "25";
3232

0 commit comments

Comments
 (0)