title: Javascript array serialized in JSON enclosed in quotes, like a string
body: <p>In my web application, why do JSON.stringify serialize my Activity's Trackpoints array as a string? Notice in the JSON representation on top that the trackpoints array is enclosed in quotes, rendering it as a string. The javascript object representation in the bottom shows clearly that trackpoints is an array.</p>
  
  <p>When this serialized activity is passed as JSON in a POST to my Sinatra back-end, Ruby parses its trackpoints as a string instead of an array of Trackpoint objects. The end result is a 500 server error, which is not what I expect.</p>
  
  <p>Precision for people unable to see the included image: "The trackpoints array is a property of a complex object. JSON.stringify encloses it in quotes while doing its job. When Ruby parses the whole serialized object, it interprets my array as a string instead of an array. That's why I want to avoid those quotes."</p>
  
  <p><img src="https://i.stack.imgur.com/jc22m.png" alt="Trackpoints array serialized with quotes"></p>