title: Program a JavaScript loop to take out characters
body: <p>Suppose I've this code:</p>
  <pre><code>XBGa_AHjhdjsDjk_sad/safasdf_Sdfsdfasfdsa
  </code></pre>
  <p>I want to take <code>XBGa_AHjhdjsDjk_sad</code> out of this. I want to run a loop in JavaScript which appends each character to a variable and if the character is <code>/</code> the loop is terminated.</p>
  <p>How do I do that?</p>