Why is this happening? (javaScript's reverse method) : <p>repl.it : <a href="https://repl.it/BuXR/3">https://repl.it/BuXR/3</a></p>

<pre><code>var str = "abc";
var str2 = str.split(" ").join("").split("");
var tmp = str2;
console.log(str2);
// =&gt; ['a','b','c']
console.log(tmp.reverse());
// =&gt; ['c','b','a']
console.log(str2);
// =&gt; ['c','b','a']
</code></pre>

<p>My question is why str2 is being changed even though it is not being reversed?</p>

<p>This is very upsetting to me, but I have a guess as to why this is happening. The tmp is just a pointer to the original str2, and when I call reverse() on tmp, it actually reverses str2. </p>

<p>Even if that really is what's happening, I still feel like it is a very counterintuitive way for a language to work. </p>
