I went ahead and follow the original instruction and input the values for a, b, and c, but there is no output as the previous screenshot said there would be. There’s no output that shows me a=6 b=15, etc... It’s all the same. Suffice to say that I am coding, but I am not seeing anything. If there’s no visual output, how would I see what I am doing. I was expecting to see a result at the end. Not just “Ok, you pass the challenge.” I am rather disappointed thank you
Why am I not seeing an output in JavaScript like in HTML? Or why there isn’t a “preview” screen like in html?
Please explain.
Thank you
```javascript
// Only change code below this line
var a=5;
var b=10;
var c ="I am a";
// Only change code above this line
a = a + 1+6;
b = b + 5;
c = c + " String!";
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51
You can add a console.log to see your output if you want:
// Only change code below this line
var a = 5;
var b = 10;
var c = "I am a";
// Only change code above this line
a = a + 1;
b = b + 5;
c = c + " String!";
console.log(a);
console.log(b);
console.log(c);
It doesn’t affect the test cases to output to the console.
It looks like @JeremyLT gave you a link to the challenge that talks about console.log which is what @marcusparsons’ explanation is about.
If you want to see the output of your variables, you can use console.log.
Different programming languages will use different syntax to print to the console.
For example, in Python, it would be print()
One key difference between HTML and CSS versus JavaScript is that HTML and CSS are markup languages that focus on styling and content. When you make a change in HTML or CSS you will see those changes right away
For JavaScript, the changes you are making are interactive so in order to see the change, you would need to either test it out on the web page or print out the results of those variables in the console.
But a console is not the same as the “preview screen.” In JS, I think that I have a screen on the right that is where I am supposed to type the code. Is that the “console” that you’re talking about? Otherwise, I don’t have the option to have a “preview screen” or “console” as you said. There’s no button for that.
As a sidenote, I think the new JS curriculum will help you “see” the JavaScript changes because the new curriculum is focused on learning by building projects.
When you make changes to your javascript code, you will be building a project at the same time and test out the functionality while you are building the project.
In the beginning, it can be hard to put the pieces to together and fully understand how javascript is supposed to work on a web page.
But once you start building projects and see your changes affect the interactivity on the web page, then it will start to make more sense.
JavaScript is a different type of programming language than a HTML and CSS. You use console.log to view variables. The output shows up in the lower right, as the lesson I linked talks about.
The team is currently building out the new curriculum. Currently there is no set date for the beta release but the team has been working really hard to build it out.
In the mean time, one of the things that helped me when I was first learning back in 2020 was building small projects.
These projects were super small, like 10 lines of javascript code small and a little bit of HTML and CSS.
But it really helped me understand how all of the pieces fit together.
Then I kept building projects with increased complexity.
I would advise you to finish the first section of the JS curriculum because that includes all of the basic building blocks. Then continue with the other sections of the JS curriculum and start building small little projects.
Here are some small project ideas to get you started
JavaScript 30 is really popular. I would suggest doing that after you have finished the other sections of the JS curriculum
Frontend mentor is really popular too.
I would suggest starting with their newbie level to practice HTML, CSS and JS projects
Thank you very much for all this information. I really appreciate it. I am on lesson 7 of the JS challenges. Soon I will begin your small project suggestions because I am dying to see how all of them work together.