当前位置:网站首页>JS input / output statements, variables
JS input / output statements, variables
2022-06-24 00:54:00 【51CTO】
#1. Output
1.prompt(’ Fill in the contents to be output ‘): Browser pop-up input box , User can input
2.alert(’ Fill in the contents to be output ‘): Pop up warning box , Output 、 Show the , Browser pop-up warning
3.console.log(’ Fill in the contents to be output ‘): Console output , For programmers to test , Browser console printouts
#2. Variable
1. Variable Overview : Variables are containers for storing data , We can get the data through the variable name , Modify and use data , Variables are the memory space that the programmer applies for in memory to store data .
A complete variable consists of a variable name and a storage space .

Every time a variable is generated , A space will be generated in our memory , When you store data in variables , The data we write will be stored in memory .
Each variable created is , We all need to generate a name for the variable , When we need to use this variable , You can directly use the variable name to replace the variable
2. Use of variables
1. Declare variables
Because the present tense ES6 So we use let Method to declare variables , Variables need to be declared with let For the back Variable name .
age It is declared by our programmers Variable name .
2. assignment
We can use = To assign values to our variable names , Our value is the value to be stored in the variable space

3. Variable syntax extension
1. Update variables
After a variable has been reassigned , Its original value will be overwritten , The variable value will be subject to the next assignment .
2. Declare multiple variables at the same time
When multiple variables are declared at the same time , Just write one let , Multiple variable names are in English ‘ comma ’ separate .

3. A special case

4. Variable naming conventions
1. By letter (A-Za-z)、 Numbers (O-9)、 Underline (_)、 Dollar symbol ($ ) form , Such as : usrAge, num01,_name
2. Case sensitive .var app; and var App; It's two variables
3. Cannot start with a number .18age It's wrong.
4. It can't be a keyword 、 Reserved words . for example : var、for、while
5. Variable names must have meaning .MMD BBD
6. Follow the hump nomenclature . Initial lowercase , The first letter of the following words needs to be capitalized .myFirstName
7. Recommended translation website : youdao ICIBA
边栏推荐
- 规律/原理/规则/法则/定理/公理/本质/定律
- Is it safe to open an account for shares of tongdaxin?
- 【ICCV Workshop 2021】基于密度图的小目标检测:Coarse-grained Density Map Guided Object Detection in Aerial Images
- Experience summary of 9 Android interviews, bytes received, Ali, advanced Android interview answer
- 通达信股票开户是安全的吗?
- [CVPR 2020] conference version: a physics based noise formation model for extreme low light raw denoising
- C语言:百马百担问题求驮法
- 13 `bs_duixiang.tag标签`得到一个tag对象
- 这不会又是一个Go的BUG吧?
- [machine learning] linear regression prediction
猜你喜欢

Skywalking installation and deployment practice

ShardingSphere-proxy-5.0.0容量范围分片的实现(五)

GNN upper edge distributor! Instead of trying to refine pills, you might as well give your GNN some tricks
![[machine learning] linear regression prediction](/img/74/9b5067bb9057049c998898ff2457f1.png)
[machine learning] linear regression prediction

GNN上分利器!与其绞尽脑汁炼丹,不如给你的GNN撒点trick吧

数字化工厂可以分为哪两类
![[CVPR 2022] high resolution small object detection: cascaded sparse query for accelerating high resolution smal object detection](/img/79/7dfc30565ddee0769ef5f1bc239b5d.png)
[CVPR 2022] high resolution small object detection: cascaded sparse query for accelerating high resolution smal object detection

C language: sorting with custom functions

Social recruitment interview is indispensable -- 1000 interview questions for Android engineers from Internet companies
![[traffic light identification] traffic light identification based on Matlab GUI [including Matlab source code 1908]](/img/0e/3103c4c5dd664196c85db9b30bcaf5.png)
[traffic light identification] traffic light identification based on Matlab GUI [including Matlab source code 1908]
随机推荐
Android 72021 latest Android interview written test questions sharing
[image detection saliency map] calculation of fish eye saliency map based on MATLAB distortion prompt [including Matlab source code 1903]
LSF opens job idle information to view the CPU time/elapse time usage of the job
[applet] realize the effect of double column commodities
Hackers can gain administrator privileges by invading Microsoft mail server and windows Zero Day vulnerability November 23 global network security hotspot
Google Earth engine (GEE) - verification results used by NDVI, NDWI and NDBI to increase classification accuracy (random forest and cart classification)
9次Android面试经验总结,已收字节,阿里,高级android面试答案
GNN upper edge distributor! Instead of trying to refine pills, you might as well give your GNN some tricks
使用递归形成多级目录树结构,附带可能是全网最详细注释。
Vulnerability recurrence - redis vulnerability summary
version `ZLIB_1.2.9‘ not found (required by /lib64/libpng16.so.16)
Common core resource objects of kubernetes
实时计算框架:Spark集群搭建与入门案例
Shardingsphere-proxy-5.0.0 implementation of capacity range partition (V)
Is it safe to open an account for shares of tongdaxin?
Installation and use of winscp and putty
Mip-NeRF:抗混叠的多尺度神经辐射场ICCV2021
C语言:递归实现N的阶乘
股票网上开户安全吗?需要满足什么条件?
js输入输出语句,变量