当前位置:网站首页>The fifth training assignment
The fifth training assignment
2022-07-07 10:56:00 【m0_ sixty-three million five hundred and fifty-two thousand nin】
1. Basic grammar
1.1 Statements and comments
javascript The execution unit of the program is line , That is, line by line execution , In general , Each line is a statement , Statement is an operation to complete a task , The statement ends with a semicolon , A semicolon indicates the end of a statement , Multiple statements end , Within one line , But when there are multiple statements on a line , Statement must end with a semicolon expression , There's no need to end with a semicolon , Usually add a semicolon after the expression ,javascript The engine treats the expression as a statement , This will produce some meaningless statements
1.2 Identifiers and keywords
An identifier is a name , Used to name variables and functions , There are specific rules and norms .
The rules :
from unicode, Numbers , Chinese composition
1. Cannot start with a number
2. Can't be keywords and reserved words
3. Case sensitive
standard :
1. Know what you know
2. Hump naming or underlining rules
1.3 Variable
A variable is a named memory space used to store data , Data can be stored in variables , You can also extract data from variables
1.3.1 Variable declarations
javascript It's a weak type of language , There is no need to specify the variable type when declaring variables , Direct use var Modifier to declare .
Variable declarations L:
var a;
a=10;
var b=29;
1.3.2 Variable notes
1. If you only declare and do not assign a value , Then the value of the variable is undefined
2. Variables have to be defined before they can be used , If the variable is not declared, use ,javascript Will report a mistake , Tell you that the variable is undefined .
3. It could be on the same line var Multiple variables are declared in the command .
4. If you use var Redeclare an existing variable is invalid
5. If you use var Redeclare an existing variable and assign a value , That overrides the previous value
6.javascript Is a dynamic type , Weak type language , in other words , There are no restrictions on the types of variables , Various types of values can be assigned
1.3.3 Variable Promotion
javascript The engine works by parsing the code first , Get all the declared code , And then run line by line , The result is the declaration of all variables , Will be promoted to the head of the code , This is called variable promotion
2 data type
although js It's a weakly typed language , Variables have no type, but the data itself is typed , For different types , We can do different operations .
javascript There is 6 Different types , There are five different types :undefined,null, Boolean , Values and strings . A complex data type object
2.1undefined
undefined The type value is undefined
undefined Is a raw value representing nothing , Means that the value does not exist
appear undefined Common situation of :
1. When declaring a variable without an initial value , The value of this variable is undefined
2. When calling a function, the function has formal parameters but no arguments , Namely undefined
3. When the function does not return a value , Default return undefined
2.2null
null Type is a data type with only one value , It's a special value null, It means null , It represents an empty object reference
2.3 Boolean type
The boolean type has two values :true,false. It is often used to judge and loop conditions
2.4 Numerical type
Numerical types include : Integer and floating point
1. All the figures are based on 64 Store for floating point
2. When storing numeric data, the floating-point type that can be converted into integer is automatically converted into integer
2.5 character string
use "" or '' Lead up
Use the plus sign “+” String splicing
边栏推荐
- Operation method of Orange Pie orangepi 4 lts development board connecting SATA hard disk through mini PCIe
- 【推荐系统 01】Rechub
- 路由器开发知识汇总
- Application of OpenGL gllightfv function and related knowledge of light source
- 使用 load_decathlon_datalist (MONAI)快速加载JSON数据
- Cluster task scheduling system lsf/sge/slurm/pbs based on HPC scenario
- What are the test preparation materials and methods for soft exam information processing technicians?
- [daiy5] jz77 print binary tree in zigzag order
- 【实战】霸榜各大医学分割挑战赛的Transformer架构--nnFormer
- [recommendation system 01] rechub
猜你喜欢
1324: [example 6.6] integer interval
Transaction rolled back because it has been marked as rollback-only解决
What does intermediate software evaluator test
Socket communication principle and Practice
555 circuit details
软考中级有用吗??
[installation system] U disk installation system tutorial, using UltraISO to make U disk startup disk
Using tansformer to segment three-dimensional abdominal multiple organs -- actual battle of unetr
Basic introduction of yarn and job submission process
Wallhaven壁纸桌面版
随机推荐
Common shortcut keys in IDA
[OneNote] can't connect to the network and can't sync the problem
JS implementation chain call
Five simple and practical daily development functions of chrome are explained in detail. Unlock quickly to improve your efficiency!
JS实现链式调用
Openinstall and Hupu have reached a cooperation to mine the data value of sports culture industry
Laya common script commands
一些线上学术报告网站与机器学习视频
TypeScript 接口继承
單調性約束與反單調性約束的區別 monotonicity and anti-monotonicity constraint
使用Tansformer分割三维腹部多器官--UNETR实战
2021 summary and 2022 outlook
shardingsphere分库分表示例(逻辑表,真实表,绑定表,广播表,单表)
2022年7月10日“五心公益”活动通知+报名入口(二维码)
“梦想杯”2017 年江苏省信息与未来小学生夏令营 IT 小能手 PK 之程序设计试题
Idea shortcut keys
滚动踩坑--UNI_APP(八)
Unity script generates configurable files and loads
P2788 math 1 - addition and subtraction
1324: [example 6.6] integer interval