Explica este código JavaScript
const name = "Lydia"
console.log(name())
- A:
SyntaxError
- B:
ReferenceError
- C:
TypeError
- D:
undefined
Respuesta en el primer comentario.
For further actions, you may consider blocking this person and/or reporting abuse
Farhan Masud Aneek -
Alex Merced -
Craftingbugs -
Callum@Calyptus -
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)
Respuesta:
C:
TypeError
name
no es ni hace referencia a una función, no tiene sentido intentar invocar a unstring
como si fuera una función.No pude ser
Syntax Error
por que no se cometio ningún error de tipeo, el código no esta mal escrito pero tampoco es un código valido.No puede ser
Reference Error
por que no hay problemas de referencia al intentar acceder a la variablename
.Se genera una excepción de tipo TypeError cuando un valor no es del tipo esperado, entonces se lanza un TypeError: name is not a function!