I am new to java script and coding, please explain for me, thank you everyone! :)

I am new to java script and coding, please explain for me, thank you everyone! :)
0

#1

Tell us what’s happening:

Your code so far


// Setup
var a;
var b = 2;

// Only change code below this line
var a =7;
var b = 7;
var a b =;

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator/


#2

We have variable declaration, it means creating a place to allow us keep something on it. we also name it for accessing it.

in js, we use var for declare one variable using var keyword, so easy like
var a;
This means create a variable(a place to keep stuff) with name a.
now you can put things(number, strings, etc…) to this a we created. using =
remember, always the right part of the = will be go to left side, example;
a=5;
means put number 5 to our variable a. so now a is 5.

We also can declare multiple variables by one var, like this
var a, b;
it’s equal to following

var a;
var b;

Once You declare a variable, you may not declare it again. it’s just like once you eat your dinner, you cannot eat it again.
so this is wrong

var a;
var a;//wrong!

Now the challenge needs you to declare two variable a and b, and assign (using =) values 5 and 7 to them.

Suggestion: if js is kind of confusing for you for now, I suggest you start from HTML and CSS, then you may have some study about flowchart and pseudocode

keep goin on great work, happy programming


#3

thank you for that, i appricate it