0
How does this command don't work and how exactly it works i didn't really get it
The command is: Var x = 10; This is the first command 👆🏻 Var x = 100; document.write(x); The 2nd command 👆🏻 Var x = 100; document.write(x); X = 42; document.write (x); The last command 👆🏻 All of them I didn't get it and doesn't work to see what they do any information? I will be really grateful for information!
8 Answers
+ 1
xxtheblade 3
Learn lesson 3.1 Variables in JavaScript course.
Variables are containers for storing data values. The value of a variable can change throughout the program.
0
Please tag the appropriate programming language.
0
xxtheblade 3
What are you doing?
That is JavaScript code
document.write is a function which is used to print value on browser.
x is a variable with different values
Did you try to do in web code?
0
Okay so first. dont capitalize the V in var. 2nd u have 3 of the same names for your variables. X = 42 doesnt work becuase javascript is case-sensetive. and why it outputs 100, 3 times is because of the same variable names the Var x = 100 which is the last variable to have “x” will output 100. If you want them to output different things change the names
0
so basically here:
var x = 10;
var x = 100;
document.write(x);
var x = 100;
document.write(x);
var x = 42;
document.write (x);
0
justice it's JavaScript
0
Your mom what does the variables does i don't have any idea?
0
its for storing data i guess u could say. var = variable so ye.