Explica este código JavaScript
console.log(typeof null == 'object'); // ?
A. true
B. false
C. TypeError
D. undefined
Respuesta en el primer comentario.
For further actions, you may consider blocking this person and/or reporting abuse
V Sai Harsha -
Guilherme Ananias -
Idris Kelani -
ryad -
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 (2)
Respuesta:
A.
true
Pese a que
null
es un primitivo, debido a un bug del lenguaje su tipo de dato esobject
.Este bug es muy antiguo y se determino que no vale la pena arreglarlo al día de hoy ya que se pueden romper muchos programas que pueden depender de esta error.
Más info:
Este bug es bastante conocido en programadores experimentados y usado en entrevistas laborales para estimar tu conocimiento del lenguaje.
No usar comparaciones sin === y tirando.