addyosmani / addyosmani/largescale-demo

Core Logic - Question

Open
#2 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
137
Forks
23
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.