javascript
function(global factory)
function globalFactory(obj) { // Create deep copy of an object let copy = Object.assign({}, obj); // Iterate over all properties of an object and make them global for (let key in copy) { window[key] = copy[key]; } } The above function is used to create a global namespace that can be accessed from anywhere