Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!