underscore.jsを使用して、リスト内の要素がtrueであるかどうかを確認しています。これがそのコーヒースクリプトコードです:
uploading = _(@getViews ".file-forms").some (view) ->
view.uploading is true
trueまたはfalseを返す代わりに、「uploading」を出力すると、次のようになります。
uploading
y
_chain: true
_wrapped: false
__proto__: Object
アンダースコアの「some」の定義は次のとおりです:http://underscorejs.org/#some。
さらに、getViewsは、https ://github.com/tbranyen/backbone.layoutmanager/wiki/Nested-viewsで定義されているバックボーンlayoutmanagerの関数です。
これをデバッグしやすくする可能性のある他の変数の出力は次のとおりです。
_(this.getViews(".file-forms"))
y
_chain: true
_wrapped: Array[1]
0: d
length: 1
__proto__: Array[0]
__proto__: Object
_
function (a){if(a instanceof y)return a;if(this instanceof y)this._wrapped=a;else return new y(a)}