1. Variable Overview1.1 Storage of variables in memoryEssence: A variable is a piece of space in memory that a program applies for to store data. 1.2 Use of variablesThe use of variables is divided into two steps: 1. Declare variables 2. Assign values 1. Declare variables//Declare a variable named age var is a JS keyword used to declare a variable. After declaring a variable using this keyword, the computer will automatically allocate memory space for the variable. age is the name of the defined variable. We need to access the allocated space in the memory through the variable name. 2. Assignmentage = 10; //Assign the value of age variable to 10 3. Initialization of variablesvar age = 10; 1.3 Variable Syntax Extension1. Update variablesWhen a variable is reassigned, its original value will be overwritten and the variable value will be based on the last assigned value. 2. Declare multiple variablesWhen declaring multiple variables at the same time, just write one var, and separate multiple variable names with commas. var age = 10,name = 'lili',sex = 2; 3. Special cases for declaring variables
1.5 Variable Naming Conventions
SummarizeThis article ends here. I hope it can be helpful to you. I also hope that you can pay more attention to more content on 123WORDPRESS.COM! You may also be interested in:
|
<<: Summary of the main attributes of the body tag
>>: Problems and solutions when replacing Oracle with MySQL
How to implement text icons through CSS /*icon st...
Preface Components are something we use very ofte...
This article example shares the specific code of ...
selinux ( Security-Enhanced Linux) is a Linux ker...
This article shares the specific code of Vue to i...
Question: Is the origin server unable to find a r...
Table of contents 1. Introduction 2. Environment ...
1. Create an empty directory $ cd /home/xm6f/dev ...
As a powerful editor with rich options, Vim is lo...
There are two ways to expose container ports in d...
This article shares the specific code of the firs...
Table of contents 1. Differences between the two ...
Table of contents Preface Features of Vue Native ...
Typically, we use the following SQL statement to ...
Table of contents What is pre-analysis? The diffe...