addyosmani / addyosmani/largescale-demo

Core Logic - Question

オープン
#2 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
137
フォーク
23
PR マージ指標
30日以内にマージされた PR はありません

説明

More of a question than a concern as I've been trying to learn more about JavaScript from your example.

In app.core the define function creates a var called 'temp' and runs the constructor. I don't understand why app.f.define is passed in as a parameter when the following check will work without it.

temp = constructor();
if (temp.init && app.utils.typeEqual(temp.init, 'function') && temp.destroy && app.utils.typeEqual(temp.destroy, 'function')) {
// Works just the same.
}

Perhaps I am not understanding the bigger picture here. Is this simply a matter of good practice?

Any help appreciated!

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。