diff --git a/javascript/4.变量.md b/javascript/4.变量.md index e46e5c0..970d3fa 100644 --- a/javascript/4.变量.md +++ b/javascript/4.变量.md @@ -81,3 +81,12 @@ - \\xnn - \\unnnn +### .length + +### .toString() + +## object + +### 创建 + +`new Object() 或者 {}` \ No newline at end of file diff --git a/javascript/5.操作符.md b/javascript/5.操作符.md new file mode 100644 index 0000000..1b73d95 --- /dev/null +++ b/javascript/5.操作符.md @@ -0,0 +1,52 @@ +# 操作符 + +## 一元操作符 + +> 只能操作一个变量的操作符叫一元操作符 + +- ++ +- -- +- + +- - + +## 布尔操作符 + +- ! +- && +- || + +## 乘性操作符 + +- * +- / +- % + +## 加性操作符 + +- + +- - + +## 关系操作符 + +- \> +- \< +- \>= +- \<= + +## 相等操作符 + +- == +- != +- === + +## 赋值操作符 + +- += +- -= +- *= +- /= + +## 逗号操作符 + +- var num1 = 1, num2 = 2; +- var num2 = (1,2,3,4) \ No newline at end of file diff --git a/javascript/6.语句.md b/javascript/6.语句.md new file mode 100644 index 0000000..205bcb1 --- /dev/null +++ b/javascript/6.语句.md @@ -0,0 +1,30 @@ +# 语句 全部实际演示一下就ok + +## if + + + +## do-while + + + +## while + + + +## for + + + +## for in + + + +## break continue + + + +## switch + + + diff --git a/javascript/7.函数.md b/javascript/7.函数.md new file mode 100644 index 0000000..43b605c --- /dev/null +++ b/javascript/7.函数.md @@ -0,0 +1,12 @@ +# 函数 + +## 定义函数 + +```javascript +function name(arg){ + .... +} +``` + +## 理解参数 + diff --git a/javascript/8.基础类型与引用类型.md b/javascript/8.基础类型与引用类型.md new file mode 100644 index 0000000..2a0847d --- /dev/null +++ b/javascript/8.基础类型与引用类型.md @@ -0,0 +1,14 @@ +# 基础类型与引用类型 + +## 基础类型 + +- string +- number +- boolean +- undefined +- null + +## 引用类型 + +- object + diff --git a/javascript/9.作用域.md b/javascript/9.作用域.md new file mode 100644 index 0000000..7331661 --- /dev/null +++ b/javascript/9.作用域.md @@ -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 +