¿Puedes explicar este código?
console.log(false == null); // false
console.log(false == undefined); // false
Siendo null
y undefined
valores falsy
, ¿por qué pasa esto?
Respuesta en el primer comentario.
For further actions, you may consider blocking this person and/or reporting abuse
It's a scientific fact.
Somtochukwu Okafor -
Suraj Vishwakarma -
Ackshaey -
sysmaya -
Once suspended, duxtech will not be able to comment or publish posts until their suspension is removed.
Once unsuspended, duxtech will be able to comment and publish posts again.
Once unpublished, all posts by duxtech will become hidden and only accessible to themselves.
If duxtech is not suspended, they can still re-publish their posts from their dashboard.
Once unpublished, this post will become invisible to the public and only accessible to Cristian Fernando .
They can still re-publish the post if they are not suspended.
Thanks for keeping DEV Community safe. Here is what you can do to flag duxtech:
Unflagging duxtech will restore default visibility to their posts.
Top comments (1)
Si bien
null
yundefined
son valoresfalsy
al momento de que javascript haga coerciones de tipo pasa algo raro, esto se debe a que tantonull
comoundefined
sólo son iguales a sí mismos y entre ellos:Solo en estos casos obtendremos como salida un
true
.Pero es recomendable usar siempre el operador estricto de igualdad
===
:Esto para evitar que javascript haga coerciones de tipos y obtengamos resultados no esperados.