Javascript remove item on array using splice() not working
<p>So I have an <strong>array</strong> like this <code>var arr = [foo1:"bar1", foo2:"bar", foo3:"bar3"]</code>.</p>

<p>Then I used this <code>arr.splice(index, 1);</code> given that the <code>index</code> is dynamic lets just say it's <code>0</code> but the value <code>foo1:"bar1"</code> wasn't removed from the <strong>array</strong>.</p>

<p>Also the above <strong>array</strong> works on my code but it shows an error on JSFiddle. I have no idea why. </p>

<p>Thanks.</p>

<p><strong>EDIT</strong>
I dont know why it doesn't show an error on my console but here's how I did it. </p>

<p>var arr = [];</p>

<p>I dynamically added value to the array by doing </p>

<pre><code>arr["foo"] = "bar";
</code></pre>

<p>which resulted to <code>[foo:"bar"];</code></p>

<p>Any idea guys?</p>

<p><strong>EDIT 2</strong></p>

<p>Here's the screenshot of the console. 
<a href="https://i.stack.imgur.com/tvmnZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tvmnZ.png" alt="enter image description here"></a></p>