269N/A`YUI.add()` is a static method that registers a reusable module—essentially, it adds a module to the set of modules available to be attached to a YUI instance via the `use()` method.
269N/ADefining a reusable YUI module is as simple as providing a name and a callback function to `YUI.add()`.
919N/A Y.MyModule = {
919N/A console.log('Hello!');
919N/ANote that there are no parentheses after `YUI` when calling `YUI.add()` as there are when calling `YUI().use()`. This is because `add()` is a static method of the global `YUI` object, not a method on a specific YUI instance. Modules are registered globally via `add()` and are later attached to a specific YUI instance via `use()`.
269N/AThe `add()` method accepts two optional arguments after the callback function: a module version string and a config object. The most useful option in the config object is `requires`, which allows you to specify an array of other YUI modules that your module requires. YUI will then be sure to load these dependencies before executing your module.
911N/AAfter your module has been added via `YUI.add()`, you can specify its name in a `use()` call to attach it to a YUI instance.
1179N/A // my-module's add() callback, so the Y.MyModule object that was created
269N/AA module's `add()` callback isn't executed until that module is attached to a YUI instance via `use()`. Each time a module is attached via `use()`, the module's `add()` callback will be executed, and will receive as an argument the same YUI instance that will later be passed to the `use()` callback.