title: .substring() , .trim().substring() are giving me different results in JavaScript why is this happening?
body: <pre><code>let val = &quot; ulimate ,&quot;
  
  console.log(&quot;result 1 : &quot;,val.substring(0 , val.length -1))
  console.log(&quot;result 2 : &quot;,val.trim().substring(0 , val.length -1))
  
  result : 
  
  result 1 :  ulimate 
  result 2 :  ulimate ,
  
  </code></pre>
  <p>.substring()  , .trim().substring() are giving separate results</p>