タグ

2011年8月19日のブックマーク (2件)

  • Underscore.js - 4 Code Reading

    Underscore.js 1.1.6のソースコードを見ていく Table of Contentsによるとそれぞれジャンル分けされているので、それに沿って読む。 Collections Arrays Functions Objects Utility Chaining 最初の初期化とか、取り決めらへん グローバル変数 Underscore.jsはというグローバル変数のみを持っていて、以下に便利な関数を 詰め込んだ感じのライブラリです。 (function() { // Establish the root object, `window` in the browser, or `global` on the server. // rootになるオブジェクト、ブラウザだとwindowだけどunderscore.jsはブラウザ以外でも使えるのでthisでグローバルをとる var root =

  • Underscore.js

    Table of Contents Collections each, map, inject, detect, select, reject, all, any, include, invoke, pluck, max, min, sortBy, sortedIndex, toArray, size Arrays first, last, compact, flatten, without, uniq, intersect, zip, indexOf Functions bind, bindAll, delay, defer, wrap Objects keys, values, extend, clone, isEqual, isElement, isArray, isFunction, isUndefined Utility uniqueId, template Collection