title: Remove last word after comma in a string jquery
body: <p>I need to remove last word after comma in a string.</p>
  
  <p>For example, i have string like below</p>
  
  <pre><code>var text = "abc, def, gh";
  </code></pre>
  
  <p>I want to remove <code>gh</code> in that string</p>
  
  <p>I have tried like below</p>
  
  <pre><code>var text = "abc, def, gh";
  var result = text.split(",");
  var get = result.substring(-1, result.length);
  alert(get);
  </code></pre>
  
  <p>But im getting error </p>
  
  <blockquote>
    <p>Cannot read property 'split' of undefined</p>
  </blockquote>
  
  <p>Please help me.</p>