Created
March 17, 2019 11:18
-
-
Save Richienb/9a4bf7c73317038fd356ea063d3fc9a2 to your computer and use it in GitHub Desktop.
UMD Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
define([], factory); | |
} else if (typeof module === 'object' && module.exports) { | |
module.exports = factory(); | |
} else { | |
root.returnExports = factory(); | |
} | |
}(typeof self !== 'undefined' ? self : this, function () { | |
// START OF YOUR CODE | |
const helloWorld = () => { | |
return "Hello World!" | |
} | |
return helloWorld; | |
// END OF YOUR CODE | |
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((root, factory) => { | |
if (typeof define === 'function' && define.amd) { | |
define([], factory); | |
} else if (typeof module === 'object' && module.exports) { | |
module.exports = factory(); | |
} else { | |
root.returnExports = factory(); | |
} | |
})(typeof self !== 'undefined' ? self : this, () => { | |
// START OF YOUR CODE | |
const helloWorld = () => { | |
return "Hello World!" | |
} | |
return helloWorld; | |
// END OF YOUR CODE | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment