Respuesta: A. true, false, false, true, true
true
false
El constructor Boolean permite convertir valores a tipo boolean.
Boolean
Los valores truthy como el número 37, un objeto vacío, o un Symbol infieren a true sin ninguna complicación.
truthy
37
Symbol
Valores como NaN, cadenas vacías o 0 al ser considerados valores falsy inferirán a false.
NaN
0
falsy
A continuación una tabla que resume todas las posibles conversiones a boolean:
x
Boolean(x)
undefined
null
number
bigint
0n
string
""
''
symbol
object
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Respuesta:
A.
true
,false
,false
,true
,true
El constructor
Boolean
permite convertir valores a tipo boolean.Los valores
truthy
como el número37
, un objeto vacío, o unSymbol
infieren atrue
sin ninguna complicación.Valores como
NaN
, cadenas vacías o0
al ser considerados valoresfalsy
inferirán afalse
.A continuación una tabla que resume todas las posibles conversiones a boolean:
x
Boolean(x)
undefined
false
null
false
true
ofalse
number
0
=>false
,NaN
=>false
number
=>true
bigint
0n
=>false
bigint
=>true
string
""
,''
,=>
false
string
=>true
symbol
true
object
true