Passing arguments into the Module - Javascript Object

Javascript examples for Object:Module

Description

Passing arguments into the Module

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <script type="text/javascript">
var GlobalModule = (function() {
    function consoleLog(textToOutput) {
        console.log(textToOutput);
    }//  w w  w  .j a  v a 2s .  c o  m
    return {
        consoleLog: consoleLog
    };
})();
GlobalModule.consoleLog('Hello')

      </script>  
   </body>
</html>

Related Tutorials