This commit is contained in:
luyuan 2020-12-21 09:26:16 +08:00
parent 04ea9eecd7
commit cf0ffb3672
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
6 changed files with 140 additions and 0 deletions

View File

@ -81,3 +81,12 @@
- \\xnn
- \\unnnn
### .length
### .toString()
## object
### 创建
`new Object() 或者 {}`

52
javascript/5.操作符.md Normal file
View File

@ -0,0 +1,52 @@
# 操作符
## 一元操作符
> 只能操作一个变量的操作符叫一元操作符
- ++
- --
- +
- -
## 布尔操作符
-
- &&
- ||
## 乘性操作符
- *
- /
- %
## 加性操作符
- +
- -
## 关系操作符
- \>
- \<
- \>=
- \<=
## 相等操作符
- ==
- !=
- ===
## 赋值操作符
- +=
- -=
- *=
- /=
## 逗号操作符
- var num1 = 1, num2 = 2;
- var num2 = (1,2,3,4)

30
javascript/6.语句.md Normal file
View File

@ -0,0 +1,30 @@
# 语句 全部实际演示一下就ok
## if
## do-while
## while
## for
## for in
## break continue
## switch

12
javascript/7.函数.md Normal file
View File

@ -0,0 +1,12 @@
# 函数
## 定义函数
```javascript
function name(arg){
....
}
```
## 理解参数

View File

@ -0,0 +1,14 @@
# 基础类型与引用类型
## 基础类型
- string
- number
- boolean
- undefined
- null
## 引用类型
- object

23
javascript/9.作用域.md Normal file
View File

@ -0,0 +1,23 @@
# 作用域
```javascript
var color = "blue";
function changeColor(){
if (color === "blue"){
color = "red";
} else {
color = "blue";
}
}
changeColor();
alert("Color is now " + color);
```
## 特殊情况
- if
- for
- ...
> 垃圾回收 gc