How to practice Javascript

Tell us what’s happening:
Describe your issue in detail here.
After reading the lesson it lets you practice on the right side of the page. I don’t understand how it works. How do I know if something is right? On the bottom where it says " running test" is there something that is supposed to go in that box? How many times do I try to get the answer right before I am able to move on?

Thank you

Your code so far

var peaches 
// var peaches// 
// var myName Peaches// 
// var myName Peaches; //
// var myName Peches; //
// var myNames; Peaches //
// var myName; //
// var myName; Peaches //
//var myName; Peaches//

I don't know what to do after this, I don't know if it's right and I don't know how to move on to next lesson. 

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36 Edg/100.0.1185.44

Challenge: Declare JavaScript Variables

Link to the challenge:

Hey there! Welcome to the forums :wave:

If your code is correct there will be no error message in the console and a pop up will come up offering you to move on.

It looks like they are just wanting you to declare an empty variable name myName.

Given the example:

var ourName;

How do you think you would do this?

1 Like

You can play around in that code editor to get familiar and practice, but if you read the challenge again carefully, you’ll see that at the end there are specific requirements for what you are supposed to do.
In this case:

Use the var keyword to create a variable called myName .

Below that will be a description of all the tests that will be run. When you run the tests, every test will have a pass or fail mark (a :white_check_mark: or an :x: ). In this case there is only one test:

You should declare myName with the var keyword, ending with a semicolon

1 Like

Thank you! Then after I do this it will allow me to move forward?

I’m putting var myName; Peaches. It still won’t let me move forward.

Hi @Peaches1 !

Welcome to the forum!

But that is incorrect.

the directions only want you to declare the variable myName.
Not assign a value to it like Peaches.

make sense?

1 Like

I did this before your response. Which one would be correct? Also some turn out green and some turn out blue. What does that mean?

var ourName;

var myNamePeaches;



var myName;

What happened when you tried the last one in your list and hit Run the Tests?
Do you get a popup like this?

Nothing happened I’m on the same page. That’s why I think I’m doing something wrong.

It might be your local setup.

I am testing everything on Google Chrome without extensions and when I use var myName; and hit run tests it passes for me.

I would suggest trying another browser and turning off extension that might be messing with the tests

I did that before and it worked, that’s how I got to the second step (where I’m stuck now) but I’ll try that.

What is your complete current code? You might want to reset the challenge and start fresh.

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