The value is determined based on the true and false values configured in the configuration file in the.
"false" as Boolean //flase"true" as Boolean //falseBoolean("flase") //trueBoolean("true")//true
"False" as Boolean is flase
Is a string, not a boolean type, so it is false
Boolean ("flase") is true
Determines whether a string is empty without looking at the content.
Obviously, this is not an empty string
Setexpression
Convert the parameter to a Boolean value and return this value.
The returned value depends on the data type and value of the parameter, as described in the following table:
Input value |
Example |
Return Value |
0 |
Boolean(0) |
false |
NaN |
Boolean(NaN) |
false |
Number (non0 OrNaN ) |
Boolean(4) |
true |
Null String |
Boolean("") |
false |
Non-Null String |
Boolean("6") |
true |
null |
Boolean(null) |
false |
undefined |
Boolean(undefined) |
false |
Object class instance |
Boolean(new Object()) |
true |
No Parameter |
Boolean() |
false |
Because you do not want to write the if statement
Boolean(Number("0"));//falseBoolean(Number("1"));//true
But this is not intuitive.
If you want to determine whether there are only
If (STR = "true ")
There are many small problems with new technologies, so I will explore and learn more slowly.