title: == operator not working inside If statement (JavaScript)
body: <p>I have a JavaScript  array called splitstatus which takes data from a variable called &quot;status&quot;. splitStatus[0] and splitStatus[1] contains text inside it .</p>
  <p>I doubled checked it by using console.log</p>
  <pre><code>let splitStatus=status.split('\n')
  for(let i=0;i&lt;splitStatus.length;i++){
    console.log(splitStatus[0]); // shows output  HI THERE
    console.log(splitStatus[1]); // shows output  HELLO WORLD 
   
  }
  </code></pre>
  <p>The code above is working as i expected, as splitStatus[0] has 'HI THERE' stored inside and splitStatus[1] has 'HELLO WORLD' inside.</p>
  <p>ISSUE:  &quot;if condition&quot;  doesn't work with the &quot;==&quot; operator as shown below</p>
  <pre><code>if (splitStatus[0]==' HI THERE '){
     
  //my code
  
    }
  </code></pre>
  <p>when i put just &quot;=&quot; it works, but i want to put &quot;==&quot;. Can someone tell me what im doing wrong. Thanks a lot for reading.</p>