當通過underscore.js圖書館去,我碰到試圖瞭解underscore.js
for (var i = 0, l = obj.length; i < l; i++) {
if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;
}
// Establish the object that gets returned to break out of a loop iteration.
breaker = {};
爲什麼在最後使用return
? i in obj
檢查什麼?
什麼功能是嗎?也許是來源的鏈接? – 2012-04-04 02:52:10
Julian Bucknall(Developer's Express的首席技術官)最近剛剛發表了一系列關於理解underscore.js的博客文章。我沒有方便的URL,但也許你可以在http://devex.com或者通過互聯網發現一個參考文章。我會盡力找到明天的鏈接,如果您當時還沒有找到答案,請更新此評論。 – 2012-04-04 02:54:48
發現的鏈路http://www.devexpress.com/Support/Webinars/details.xml?id=UnderscoreJS](http://www.devexpress.com/Support/Webinars/details.xml?id=UnderscoreJS) – Lordking 2012-04-04 08:07:51