There are some rules to consider when defining variables. The variables we have defined can be a mathematical operation or a classic character. It is entirely up to you to use the variable that you have defined and assigned or not.
- When defining a variable, variable names can contain letters, numbers, underscores, and dollars.
- As I mentioned above, variable names can start with letters, numbers, underscores, and dollars.
- Variable names are case-sensitive. You have to watch out for this.
- When defining a variable name, the name must not contain spaces.
- The variable name must not contain Turkish characters when defining the name.
In the example above, we now learn to use
var before defining variables. Before defining the variable, we present the name of the variable. As you see it as a variable, we may even specify something as a mathematical operation. But if we are a method of defining a variable that is different from the other instead of writing the var command:
In this example, we have specified that we will define a variable using only one var command. After that, for each variable we define, we can put a comma and then write the name of the variable. On the other hand, when I write something with the plus operator, which is the merge operator, as you have seen, I can make it print by leaving a space.
If we are going to add the situation, the most important things we need to pay attention to are to obey the variable definition rules and assign something we want into the variable we define. These can be a character and many more in mathematical operations. In this regard, you can specify the value of the variable in the line above or in the line below and use the variables as you would like.