Comparing two empty array not working in javascript : <p>In my current project I am taking a request parameter with a value of either array or a string. But if I get an array it would be an empty array. So what I did is I checked the type first and then I worked with the value. But then I did something like this</p>

<pre><code>const reqParam = []
if (reqParam === []) {
    console.log('empty array')
} else {
    console.log('string')
}
</code></pre>

<p>But <code>reqParam</code> despite of being an empty array is giving me false while comparing with <code>[]</code>. Why it is behaving like this? Thanks in advance.</p>
