The programming languages are the same. JS also contains variables.
First, JS variables are case sensitive. Note that number and Number are different variables. Whether it is a common type or an Object type, for example, Object obj and Object Obj are two objects.
Then assign values to variables, which are basically the same. You can declare the values before assigning values,
Var I; I = 0;
You can also assign values when declaring them,
Var I = 2;
If you do not assign a value to a variable, it will not change, for example
Var I = 2; var I;
Because I is not re-assigned, I is still 2.
The object variables are interesting. You do not need to create a class for those java and c #, and then declare fields and attributes. Assign values to attributes after final instantiation.
In JS, you can declare attributes and assign values to each other.
Object data = new Object (); data. ID = "qwert123"; data. Name = "yys"; data. Content = "This is an Object! ";
...
That is to say, you can arbitrarily declare the attributes of your object. Here is what I think is more comfortable to use.
Because js is weak, most of the basic types are var declarations, and objects are objects.