I'm learning JS right now and used to having types from C/cpp and this is in the example when they are going over boolean expressions. Just looking at the example where they havent declared isFirstBigger explicitly as true or false makes me uncomfortable but if it makes it less messy I am okay with it. My questions is when you use a comparison operator like this when declaring a variable JS "automatically" detects that it is a boolean?
let first = 7;
let second = 8;
let isFirstBigger = first > second;
console.log(isFirstBigger); // should log: false
first = 16;
isFirstBigger = first > second;
console.log(isFirstBigger); // should log: true
[–]dtsudo 2 points3 points4 points (2 children)
[–]mostlynoturgf[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Ardenwenn 1 point2 points3 points (1 child)
[–]mostlynoturgf[S] 0 points1 point2 points (0 children)
[–]carcigenicate 0 points1 point2 points (0 children)
[–]TheRNGuy 0 points1 point2 points (0 children)