https://github.com/qianlongo/underscore-analysis
underscore.js源码分析一点点进行中,欢迎watch
https://github.com/qianlongo/underscore-analysis
javascript underscore
Last synced: 9 months ago
JSON representation
underscore.js源码分析一点点进行中,欢迎watch
- Host: GitHub
- URL: https://github.com/qianlongo/underscore-analysis
- Owner: qianlongo
- License: mit
- Created: 2016-11-06T13:40:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-08-02T15:31:09.000Z (almost 8 years ago)
- Last Synced: 2025-06-12T13:05:50.991Z (12 months ago)
- Topics: javascript, underscore
- Language: JavaScript
- Homepage: https://github.com/qianlongo/underscore-analysis
- Size: 59.6 KB
- Stars: 53
- Watchers: 17
- Forks: 7
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE
Awesome Lists containing this project
README
## 愿景
> 一直希望有一个机会可以阅读某库的源码,并写一些自己的想法和思考,最终将目标定在underscore.js,一个纯粹的js工具库,没有dom、bom的参与。
下划线的许多api都是日常工作中会用到的,诸如`each`,`map`,`bind`,`isUndefined`...等,试想如果深入其中把这些api都整明白了,是不是会有许多收获呢!想想还有些小激动。
## 阅读源码这几个月
> 老实说静下心来看完一个库是比较难得一件事,从开始阅读下划线到现在过去几个月,终于把它给整的差不多了,期间也看了网上别人的下划线源码分析(比如@老姚的[underscore库源码分析系列](http://www.qdfuns.com/house/17398/note/class/id/bb6dc3cabae6651b94f69bbd562ff370.html)就非常的不错),这个过程有`心累`,有`慵懒`,有`喜悦`,有`收获`,原来坚持去做一件事真的能令人开森,如果你有兴趣,也可以花点时间去阅读下划线,相信你也会有所收获。
## 文章书写计划
> 下划线的api组成总体来说分成
1. object方法类
2. 集合方法类
3. array方法类
4. function方法类
5. 工具方法类
所以基本上会按照这样的大的类别划分来书写源码分析的文章,中间可能会结合其他的js知识写一些零碎的文章。(路漫漫其修远兮,要加油啊,吼吼吼)
## 源码预览
[全文注释版本](https://github.com/qianlongo/underscore-analysis/blob/master/underscore-notes.js)
[下划线源码](https://github.com/qianlongo/underscore-analysis/blob/master/underscore-1.8.3.js)
## 文章列表
* [(void 0)与undefined之间的小九九](https://github.com/qianlongo/underscore-analysis/issues/4) (2017-5-9)
* [那些不起眼的小工具?](https://github.com/qianlongo/underscore-analysis/issues/5) (2017-5-10)
* [教你认清这8大杀手锏](https://github.com/qianlongo/underscore-analysis/issues/6) (2017-5-11)
* [悄悄地说一个bug](https://github.com/qianlongo/underscore-analysis/issues/7) (2017-5-12)
* [如何写一个实用的bind?](https://github.com/qianlongo/underscore-analysis/issues/8) [2017-5-21]
* [你要看看这些有趣的函数方法吗?](https://github.com/qianlongo/underscore-analysis/issues/9) [2017-5-26]