title: JavaScript SyntaxError: JSON.parse: unexpected character line 1
body: <p>In Python I load a variable with data then convert it to json with this code.</p>
  
  <pre><code>jsVar = (json.dumps(jsPass)) 
  </code></pre>
  
  <p>which produces this output. {"TT1004": [[1004, 45.296109039999997, -75.926546579999993, 66.996664760000002, 150, false]], "TT1001": [[1001, 45.296471220000001, -75.923881289999997, 64.616423409999996, 150, false]], "TT1003": [[1003, 45.296109379999997, -75.926543379999998, 67.240025419999995, 150, false]], "TT1002": [[1002, 45.29626098, -75.924908610000003, 65.300880480000004, 150, true]]} </p>
  
  <p>The output passes validation on the JSON Formatter &amp; Validator website. When I run the javaScript code</p>
  
  <pre><code>var myVar2 = {};
  var myVar2 = JSON.parse(jsVar); 
  </code></pre>
  
  <p>I get the following error</p>
  
  <p>SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data. </p>
  
  <p>I am not very strong with JS and new to JSON. Any constructive comments, website or literature suggestions will be greatly appreciated.</p>
  
  <p>Better Focus on the actual Issue.
  From your very helpful explanations and questions I can see that I don’t need to parse the data. As has been stated here the variable holds valid JavaScript array data. What I’m discovering is that the variable generated in Python is not the variable that I’m accessing in JS, even though they are in the same file location and have the same name. The process is set up to run like this. First, the Python code generates the JSON variable, second the JavaScript code assigns a variable with the data from the variable generated in Python and then the HTML file is fired to execute the JS code.  When I look at the output of the console.log or .dir methods for the JavaScript variable there is no data. What I need to learn is how to import the Python variable into the JavaScript Code. I don’t know whether this question can be answered here or should I ask another question in StackOverFlow? </p>