当前位置:网站首页>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
边栏推荐
- Android - basics you need to know about JNI development, interview questions for Android engineers
- 阿里巴巴面试题:多线程相关
- [technology planting grass] on the "double 11" of this year, Tencent cloud lightweight servers will be collected in a fair manner
- What do NLP engineers do? What is the work content?
- version `ZLIB_1.2.9‘ not found (required by /lib64/libpng16.so.16)
- 13 `bs_duixiang.tag标签`得到一个tag对象
- 钟珊珊:被爆锤后的工程师会起飞|OneFlow U
- Efficient integration of heterogeneous single cell transcriptome with scanorama
- 苹果Iphone14搭载北斗导航系统,北斗VS GPS有哪些优势?
- Shutter time selector
猜你喜欢

【CVPR 2022】高分辨率小目标检测:Cascaded Sparse Query for Accelerating High-Resolution Smal Object Detection

How to get started with machine learning?
![[digital signal] spectrum refinement based on MATLAB analog window function [including Matlab source code 1906]](/img/b3/ad289400e9c74f6f1f533a7d560d5c.jpg)
[digital signal] spectrum refinement based on MATLAB analog window function [including Matlab source code 1906]

实时计算框架:Spark集群搭建与入门案例

Interview notes for Android outsourcing workers for 3 years. I still need to go to a large factory to learn and improve. As an Android programmer

阿里巴巴面试题:多线程相关

What should I pay attention to in the interview of artificial intelligence technology?

实时计算框架:Flink集群搭建与运行机制

MIP nerf: anti aliasing multiscale neural radiation field iccv2021
![[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语言:利用自定义函数排序
If you want to open an account for stock trading, is it safe to open an account online-
LSF opens job idle information to view the CPU time/elapse time usage of the job
DML operation
DML操作
Interview notes for Android outsourcing workers for 3 years. I still need to go to a large factory to learn and improve. As an Android programmer
产业互联网时代将依靠源自于产业本身的产品、技术和模式来实现的
Pure JS implementation determines whether the IP is pinged
13 `bs_duixiang.tag标签`得到一个tag对象
杂乱的知识点
Open source model library of flying propeller industry: accelerating the development and application of enterprise AI tasks
Google Earth engine (GEE) - verification results used by NDVI, NDWI and NDBI to increase classification accuracy (random forest and cart classification)
智能制造时代下,MES管理系统需要解决哪些问题
【Redis进阶之ZipList】如果再有人问你什么是压缩列表?请把这篇文章直接甩给他。
[iccv workshop 2021] small target detection based on density map: coarse-grained density map guided object detection in aerial images
现在网上开股票账户安全吗?选择国有券商,最快8分钟开户成功
Building a digital software factory -- panoramic interpretation of one-stop Devops platform
【小程序】实现双列商品效果
JS language precision problem
Interview notes for Android outsourcing workers for 3 years. You still need to go to a large factory to learn and improve when you have the opportunity. Interview questions for Android Development Int