-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from GuoXiCheng/dev-c
add sparse-array md
- Loading branch information
Showing
14 changed files
with
42 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
--- | ||
aside: false | ||
--- | ||
|
||
# 什么是 Vue | ||
|
||
## Vue 是什么 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
--- | ||
aside: false | ||
--- | ||
|
||
# history 对象 | ||
|
||
## 什么是 history 对象 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
--- | ||
aside: false | ||
--- | ||
|
||
# screen 对象 | ||
|
||
## 什么是 screen 对象 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
--- | ||
aside: false | ||
--- | ||
|
||
# 什么是 BOM | ||
|
||
BOM 的全称是“浏览器对象模型”,通常用来描述浏览器提供的对象,允许开发中与浏览器窗口进行交互。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
--- | ||
aside: false | ||
--- | ||
|
||
# 节点层级 | ||
|
||
## 什么是节点层级 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
--- | ||
aside: false | ||
--- | ||
|
||
# 什么是 DOM | ||
|
||
DOM 的全称是“文档对象模型”,它是 HTML 和 XML 文档的编程接口。 | ||
|
31 changes: 31 additions & 0 deletions
31
src/javascript/ecma-script/collection-reference/array/sparse-array.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# 稀疏数组 | ||
|
||
## 什么是稀疏数组 | ||
|
||
数组中某些索引没有分配值的数组称为稀疏数组。稀疏数组的长度大于其元素的个数。 | ||
|
||
::: details 稀疏数组与密集数组的区别 | ||
稀疏数组的一个特点是数组的某些索引没有分配值,因此即使数组的每个索引都被复制为 `null` 或 `undefined`,这个数组严格意义上也不是稀疏数组。 | ||
|
||
<<< @/../projects/javascript-sandbox/src/array-method/sparse-array.ts#sparse-array-vs-dense-array | ||
::: | ||
|
||
## 创建稀疏数组 | ||
|
||
创建稀疏数组的常用方法是给数组的高位索引赋值。 | ||
|
||
稀疏数组的 `length` 属性计算方式是数组中最大索引值加一,因此稀疏数组中的实际元素个数会小于数组的长度。 | ||
|
||
<<< @/../projects/javascript-sandbox/src/array-method/sparse-array.ts#create-sparse-array | ||
|
||
## 检查稀疏数组 | ||
|
||
可以使用 `in` 或者 `hasOwnProperty` 方法来检查稀疏数组中的索引是否存在。 | ||
|
||
<<< @/../projects/javascript-sandbox/src/array-method/sparse-array.ts#check-sparse-array | ||
|
||
## 遍历稀疏数组 | ||
|
||
`for...in` 和 `forEach` 循环会跳过稀疏数组中的空位,而简单 for 循环和 `for...of` 循环不会。 | ||
|
||
<<< @/../projects/javascript-sandbox/src/array-method/sparse-array.ts#iterate-sparse-array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
--- | ||
aside: false | ||
--- | ||
|
||
# AMD | ||
|
||
AMD(Asynchronous Module Definition)是一种异步模块定义规范,它以浏览器为目标执行环境。 | ||
|
4 changes: 0 additions & 4 deletions
4
src/javascript/ecma-script/module/module-before-es6/commonjs.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
--- | ||
aside: false | ||
--- | ||
|
||
# CommonJS | ||
|
||
CommonJS 规范以同步方式声明依赖的模块,主要用于服务器端实现模块化,也可用于浏览器环境,但不能在浏览器环境中直接运行。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
--- | ||
aside: false | ||
--- | ||
|
||
# IIFE | ||
|
||
为了提供必要的封装和隔离,ES6 之前的模块会使用立即调用函数表达式(IIFE)将模块的定义封装在匿名闭包中来实现模块模式。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
--- | ||
aside: false | ||
--- | ||
|
||
# UMD | ||
|
||
UMD(Universal Module Definition)是一种通用模块定义规范,它是为了统一 CommonJS 和 AMD 两种模块定义规范而设计的。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
--- | ||
aside: false | ||
--- | ||
|
||
# 理解模块 | ||
|
||
## 理解模块模式 | ||
|
This file was deleted.
Oops, something went wrong.