title: Is there a python strip function equivalent in javascript?
body: <p>Python's strip function is used to remove given characters from the beginning and end of the string. How to create a similar function in javascript?</p>
  
  <p>Example:</p>
  
  <pre><code>str = "'^$   *# smart kitty &amp;  ''^$*   '^";
  newStr = str.strip(" '^$*#&amp;");
  console.log(newStr);
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>smart kitty
  </code></pre>