Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

142
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda