Basic JavaScript - Declare JavaScript Variables

Tell us what’s happening:
Describe your issue in detail here.

Your code so far

var myName  = "Wladimir";
console.log("Wladimir");

Your browser information:

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

Challenge: Basic JavaScript - Declare JavaScript Variables

Link to the challenge:

Welcome to the forum!
Lets figure out some things about your code

What is myname?
What is "Wladimir"?
What is Wladimir?

Wladimir is my name!
Wladimir is my name!

I get it.
But I was talking about the code specifically.

Your task is:
Use the var keyword to create a variable called myName .

When i need to create variable I can do it like:

var randomVariable;

When I need to create variable and assign value to it, it can look like:

var randomVariable = 'randomValue'
1 Like

Hi,

I am also learning javascript here. I apologise in advance if the explanation doesn’t help.

Firstly, console.log accepts string in quotes. And Wladamir is a string.

Secondly, you have assigned “Wladamir” which is a string to a variable, myName.

Now, Imagine, I present you a :gift: which has a watch.
Now, you can only get your watch by opening the gift box. Without going through it, you can’t have the watch.

So answer this, if you are console.log which item you can see first, gift box or watch?

Let me know if it helps,

1 Like

спасибо большое за совет