Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Object JavaScript - Defining a module
// Import all modules in a single location
define([ "libs/otherModule" ],
function (otherModule) {
// Export your module as an object
return {
myFunction: function () {
otherModule.otherExportedFunction() + 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment