Printing variables to console

I am doing a project in the JavaScript lessons. I am at the very beginning of the lessons. I am trying to finish the Dog Years project and it wants me to print two variables to the console. They also want me to do this using console.log(). I am totally stuck.

And why is this a problem? console.log() shouldn’t be something new, right?

Right it’s not new but I’m not sure how to insert two variables into it. Everything I try comes back with an error.

you could check documentation:

if you get an error, i can only help you if i get the code so i can reproduce the problem

const myAge = 2;
let earlyYears = 2;
earlyYears *=10.5;
let laterYears = myAge - 2;
laterYears *=4;
//Multiply laterYears

If you’d like to check your work at this point, print earlyYears and laterYears to the console. Are the values what you expected?
Check off this task when you’re ready to move on.

Use console.log() to print to the console.

This is what I am trying to do right now. The top is what I have as of now. The bottom is the step of the project that I am stuck on. I am not sure what have I done wrong or what it is that I am not seeing or doing.



you pass no arguments to console.log(), why?

I haven’t saved any of it cause it puts out errors when I run it

what have you attempted to produced errors?

url for quick exercise access for me.

you can simply pass multiple arguments to a method by separating them by a comma (it was in the documentation i linked to)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.