Why is this string unparseable?
<pre><code>JSON.parse('["foo", "bar\\"]'); //Uncaught SyntaxError: Unexpected end of JSON input
</code></pre>

<p>When I look at the above code everything seems grammatically correct. It's a JSON string that I assumed would be able to be converted back to an array that contains the string "foo", and the string "bar\" since the first backslash escapes the second backslash.</p>

<p>So why is there an unexpected end of input? I'm assuming it has something to do with the backslashes, but I can't figure it out.</p>