Comments (20)
lodash+1
from underscore-analysis.
lodash+1
from underscore-analysis.
lodash +11
from underscore-analysis.
lodash +1
from underscore-analysis.
lodash+1
from underscore-analysis.
from underscore-analysis.
@lixuejiang 这个还真不是
from underscore-analysis.
写的很不错,点个赞
from underscore-analysis.
想你学习了。我打算追随你的脚步了。我作为js初学者,只是对几个重要的概念有了了解,但是还没有真正的深入研究过使用过。
from underscore-analysis.
学习大牛,刻骨专研的精神。
from underscore-analysis.
_.contains = _.includes = _.include = function (obj, item, fromIndex, guard) {
// 代码
};
这个方法第四个参数的作用是什么?
from underscore-analysis.
lodash+1 前不久细读过源代码,奈何水平不够,很多看不懂
from underscore-analysis.
楼主好人,楼主加油。
from underscore-analysis.
学到了很多,谢谢,期待看到楼主继续出其他解读的文章
from underscore-analysis.
楼主在underscore的解读中的2200-2201行标注了
// 这一步有必要?
var obj = Object(object);
我在看这里的时候发现_.isMatch方法中只对传入的attrs进行了对象检测,而没有对object进行检测,所以传入的object参数可能并不是一个对象,也可以是单纯的字符串
比如: object是 'string',而attrs是 ['s', 't', 'r', 'i', 'n', 'g']
如果源码中没有 var obj = Object(object); 这一句的话,将会在执行2211行中的 key in obj 时报错:Uncaught TypeError: Cannot use 'in' operator to search for '0' in string at Function._.isMatch
具体为什么我也没弄懂,真萌新菜鸟一枚。。只是知道了这一步是有必要的
from underscore-analysis.
感谢这么好的文章,这么好的注释;作为初学者,看不懂underscore 码源,英语不好,看会头大,哈哈,今天终于找到这么好的文章,饿要开心的看下去了,,再次感谢!!
from underscore-analysis.
lodash +1000000
但是 lodash 的代码比较多,拆的比较细,提取不少了 internal方法,写的不如 underscore 直白,看的时候很蛋疼。
不晓得楼主有什么比较好的方式呢?
from underscore-analysis.
ramda +10086
from underscore-analysis.
good!
from underscore-analysis.
from underscore-analysis.
Related Issues (20)
- JavaScript 数组乱序 HOT 13
- 浅谈 underscore 内部方法 group 的设计原理 HOT 3
- 带注释的源码中var _ = function (obj) {....}中有个疑问 HOT 4
- 关于 bind 你可能需要了解的知识点以及使用场景 HOT 2
- bind 方法的兼容实现 HOT 1
- JavaScript 函数节流和函数去抖应用场景辨析 HOT 17
- underscore 函数去抖的实现 HOT 20
- underscore 函数节流的实现 HOT 8
- 从斐波那契数列求值优化谈 _.memoize 方法 HOT 6
- Function Functions 相关源码拾遗
- 浅谈 Web 中前后端模板引擎的使用 HOT 19
- Underscore _.template 方法使用详解 HOT 3
- Underscore 整体架构浅析 HOT 15
- 疑问:模块导出中,向后兼容老的require() API HOT 1
- 源码
- 打扰一下,有一个问题想咨询你一下 HOT 9
- 你好请教个问题 HOT 1
- 你好...在谷歌浏览器中运行`Object.prototype.toString().call(abb)`会报错 //var abb = true HOT 2
- 關於underscore源碼中提到了25個扩展方法之疑問? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from underscore-analysis.