Skip to content

Instantly share code, notes, and snippets.

@rgwozdz
Created April 11, 2018 12:47
Show Gist options
  • Select an option

  • Save rgwozdz/91abc58b7f6b2dcbc95c38b977e68686 to your computer and use it in GitHub Desktop.

Select an option

Save rgwozdz/91abc58b7f6b2dcbc95c38b977e68686 to your computer and use it in GitHub Desktop.
Parse a comma delimited list of arrays to an enclosing array
let geom = {"Polygon_Geometry": ["[-117.10, 34.20],[-117.19, 34.05],[-118.19, 34.20],[-117.10, 34.20]"]}
let json = `[${geom.Polygon_Geometry[0]}]`;
console.log(JSON.parse(json))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment