From cf0ffb3672b974dd11d00e8394e209cf9af7db36 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Mon, 21 Dec 2020 09:26:16 +0800 Subject: [PATCH] js --- javascript/4.变量.md | 9 ++++++ javascript/5.操作符.md | 52 ++++++++++++++++++++++++++++++ javascript/6.语句.md | 30 +++++++++++++++++ javascript/7.函数.md | 12 +++++++ javascript/8.基础类型与引用类型.md | 14 ++++++++ javascript/9.作用域.md | 23 +++++++++++++ 6 files changed, 140 insertions(+) create mode 100644 javascript/5.操作符.md create mode 100644 javascript/6.语句.md create mode 100644 javascript/7.函数.md create mode 100644 javascript/8.基础类型与引用类型.md create mode 100644 javascript/9.作用域.md 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 +