¿Qué imprime este código JavaScript?
!!null;
!!"";
!!1;
- A:
false
true
false
- B:
false
false
true
- C:
false
true
true
- D:
true
true
false
Respuesta en el primer comentario.
For further actions, you may consider blocking this person and/or reporting abuse
☝️ Check out this all-time classic DEV post on visualizing Promises and Async/Await 🤓
Silvestar Bistrović -
Thomas Bnt -
Armen Vardanyan -
Jagroop Singh -
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:
false
false
true
El operador
!!
realiza una doble negación.En el primer caso, por coerción de tipos,
null
es un valor falsy, si lo negamos 2 veces, tendríamosfalse
.En el segundo caso, por coerción de tipos,
""
es un valor falsy, si lo negamos 2 veces tendríamosfalse
.Por último, el tercer caso, y nuevamente por coerción de tipos, el valor
1
es un valortruthy
, si lo negamos 2 veces, obtendremostrue
.B: false false true