Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

134
Visualizações
is there a reason why the alert box text after course isn't be put in the alert box?

This is the alert box I made within the google chrome developer console, I'm a beginner following along with a course and I'm confused as to why none of the text after the word course is being displayed in the alert box.

alert(" Welcome " + myName + " to the javascript basics course ", " I'm your tutor ", + yourName + "!" );
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You've got a comma in there which makes it so that you are passing 2 arguments to the alert function, when in reality alert only accepts 1 argument. So therefor the 2nd argument (containing "I'm your tutor....") is being ignored.

You have 2 options:

Option 1:

Remove the comma so that 1 argument is passed to alert:

alert("Welcome " + myName + " to the javascript basics course, I'm your tutor " + yourName + "!");

Option 2 (Better):

Use template strings instead of concatenation:

alert(`Welcome ${myName} to the javascript basics course, I'm your tutor ${yourName}!`);
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda