title: window function clarification in javascript
body: <p>this is probably simple. I am implementing the charts plugin from <a href="http://www.chartjs.org/" rel="nofollow">http://www.chartjs.org/</a></p>
  
  <p>In the bar.html sample file it has this code:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Bar Chart&lt;/title&gt;
          &lt;script src="../Chart.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div style="width: 50%"&gt;
              &lt;canvas id="canvas" height="450" width="600"&gt;&lt;/canvas&gt;
          &lt;/div&gt;
  
  
      &lt;script&gt;
      var randomScalingFactor = function(){ return Math.round(Math.random()*100)};
  
      var barChartData = {
          labels : ["January","February","March","April","May","June","July"],
          datasets : [
              {
                  fillColor : "rgba(220,220,220,0.5)",
                  strokeColor : "rgba(220,220,220,0.8)",
                  highlightFill: "rgba(220,220,220,0.75)",
                  highlightStroke: "rgba(220,220,220,1)",
                  data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
              },
              {
                  fillColor : "rgba(151,187,205,0.5)",
                  strokeColor : "rgba(151,187,205,0.8)",
                  highlightFill : "rgba(151,187,205,0.75)",
                  highlightStroke : "rgba(151,187,205,1)",
                  data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
              }
          ]
  
      }
      window.onload = function(){
          var ctx = document.getElementById("canvas").getContext("2d");
          window.myBar = new Chart(ctx).Bar(barChartData, {
              responsive : true
          });
      }
  
      &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>In the code it has window.myBar= new Chart....</p>
  
  <p>What is myBar?  Is this just a variable like any other variable? What does the window. in front of it do?</p>