title: Explain image.src.match in javascript
body: <p>I was following this tutorial and I found some javascript code difficult to understand.</p>
  
  <p>Link to tutorial</p>
  
  <p><a href="http://www.w3schools.com/js/tryit.asp?filename=tryjs_lightbulb" rel="noreferrer">http://www.w3schools.com/js/tryit.asp?filename=tryjs_lightbulb</a></p>
  
  <p>Code I need to clarify</p>
  
  <pre><code>&lt;script&gt;
  function changeImage() {
      var image = document.getElementById('myImage');
      if (image.src.match("bulbon")) {
          image.src = "pic_bulboff.gif";
      } else {
          image.src = "pic_bulbon.gif";
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I do not understand what MATCH (in image.src.match) actually means.
  Is it something that has a toggling action.
  I could not find any useful article for this.</p>