title: how to call user-defined function of a window object in javascript
body: <p>I am trying to call a function from outside which is defined with in a window object, but it throws an error.</p>
  
  <pre><code>    window.vcm = (function() {
      "use strict";
       function red(){
        alert('red');
       }   
     });  
    vcm.red();//Error at this line...
  </code></pre>
  
  <p>I am new to OOPS in javascript. Can somebody tell me how to call this function here.</p>