@@ -1,8 +1,6 @@
# 查找散杂数
-## 题目
-
-<https://www.codewars.com/kata/find-the-stray-number>
+## 题目 [^1]
You are given an odd-length array of integers, in which all of them are the same, except for one single number.
@@ -18,6 +16,8 @@ Examples:
[17, 17, 3, 17, 17, 17, 17] => 3
```
+[^1]: <https://www.codewars.com/kata/find-the-stray-number>
+
## 思路一
数组过滤,散杂数的特征是首次出现的下标和最后一次出现的下标应保持一致(仅出现一次)。
# 奇数求和
-<https://www.codewars.com/kata/sum-of-odd-numbers>
Given the triangle of consecutive odd numbers:
@@ -21,6 +19,8 @@ rowSumOddNumbers(1); // 1
rowSumOddNumbers(2); // 3 + 5 = 8
+[^1]: <https://www.codewars.com/kata/sum-of-odd-numbers>
## 解题思路
当成数学题来做。
@@ -1,8 +1,8 @@
-# Electron
+# Electron [^1]
目前支持:Mac、Win、Linux三个平台。
-快速示例: <https://github.com/electron/electron-quick-start>
+[^1]: 快速示例: <https://github.com/electron/electron-quick-start>
## 打包工具
@@ -14,9 +14,9 @@ npm install -g babel-cli
npm install koa@v2.0.0-alpha.3
-(更新本文时的最新版本为2.0 alpha)
+(更新本文时的最新版本为2.0 alpha [^1])
-最新版本: [https://github.com/koajs/koa](https://github.com/koajs/koa)
+[^1]: 最新版本: <https://github.com/koajs/koa>
## 带async的示例
@@ -1,9 +1,9 @@
-# React and Redux
-中文文档: <https://github.com/camsong/redux-in-chinese>
+# React and Redux [^1]
> view层发出actions通知触发store里的reducer从而来更新state;state的改变会将更新反馈给我们的view层,从而让我们的view层发生相应的反应给用户。
+[^1]: 中文文档: <https://github.com/camsong/redux-in-chinese>
## 流程图

@@ -1,6 +1,6 @@
-# Socket.IO
+# Socket.IO [^1]
-<http://socket.io/>
+[^1]: <http://socket.io/>
## Server
-# Vue
+# Vue [^1]
-官方文档: <https://cn.vuejs.org/>
+[^1]: 官方文档: <https://cn.vuejs.org/>
特色是单文件组件(模块化开发)。
@@ -1,16 +1,14 @@
# 正则替换
-## RegExp 对象
+## RegExp 对象[^1]
-参考: <https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp>
+[^1]: 参考: <https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp>
工具:
* RegExp tester (Chrome插件)
-## 例题
-<https://www.codewars.com/kata/create-phone-number>
+## 例题[^2]
Write a function that accepts an array of 10 integers (between 0 and 9), that returns a string of those numbers in the form of a phone number.
@@ -23,6 +21,8 @@ createPhoneNumber([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) // => returns "(123) 456-7890"
The returned format must be correct in order to complete this challenge.
Don't forget the space after the closing parenthese!
+[^2]: <https://www.codewars.com/kata/create-phone-number>
答案:
```js
@@ -101,8 +101,6 @@ window.addEventListener('scroll', debounce(testFunc));
### Benchmark测试
-<!-- more -->
benchmark脚本:
@@ -23,6 +23,9 @@
需要注意`Webpack` 2.x.x 版本与 1.x.x 版本发生了不少改动[^1]。
+[^1]: 可以参考迁移文档: <https://webpack.js.org/guides/migrating/> 进行学习。
### 坑1: extract-text-webpack-plugin
该插件 NPM 最新版本为1.0.1,不支持 Webpack2,所以需要通过安装 RC3 版本来获得对应支持。
@@ -195,6 +198,8 @@ module.exports = (lang = 'default') => {
### Hosts.js[^2] 分级列表
+[^2]: Hosts.js项目源码: <https://github.com/js-cool/Hosts.js>
特点:
* 支持顶级项目
@@ -600,8 +605,6 @@ module.exports = class Category {
#### Demo
-测试添加:
import Category from './category';
@@ -642,8 +645,3 @@ const data = categories.reload();
console.log(JSON.stringify(data, null, 2));
-[^1]: 可以参考迁移文档: <https://webpack.js.org/guides/migrating/> 进行学习。
-[^2]: Hosts.js项目源码: <https://github.com/js-cool/Hosts.js>