DEV Community

Cristian Fernando
Cristian Fernando

Posted on

Paracetamol.js💊| #43: Explica este código JavaScript

Explica este código JavaScript

function sayHi(name) {
  return `Hi there, ${name}`
}

console.log(sayHi())
Enter fullscreen mode Exit fullscreen mode
  • A: Hi there
  • B: Hi there, undefined
  • C: Hi there, null
  • D: ReferenceError

Respuesta en el primer comentario.


Top comments (4)

Collapse
 
duxtech profile image
Cristian Fernando

Respuesta
B: Hi there, undefined

En javascript los parámetros tienen por defecto el valor undefined, esto quiere decir que sino pasamos ningún parámetro a una función que los necesite tendremos undefined.

Collapse
 
punisher49 profile image
punisher49

@areablogger any way to blacklist non-english posts?? Any tag?

Collapse
 
michaeltharrington profile image
Michael Tharrington

Hey there,

I work at DEV as a Community Manager and really must suggest that you think more empathetically about how this question might be received here. You may not mean to be disrespectful, but please understand how this might be discouraging to the author and anyone else writing non-English posts. Please just be more careful in the future and if you have sensitive questions about platform mechanics, just message into yo@dev.to and we'll be happy to help.

To be clear, we are trying to do more to offer i18n and localization options across the site because we really want to encourage folks from non-English backgrounds to write more in our community and we want to make sure they are adequately supported. We also want to give individuals the ability to see more posts in the languages that they desire, so hopefully will be improving this over time.

For now, I believe Cristian is doing everything they can to signal to readers that this is a post in Spanish. Their title is in Spanish and their also using the #spanish tag which isn't required but is a great addition!

Collapse
 
duxtech profile image
Cristian Fernando

@michaeltharrington thank you very much for leaving that comment. I know that most of the posts are in English, I still haven't mastered it enough to write posts in this language but I hope in the future to be able to contribute posts in English. Greetings.