-2

Here I attached json result.

"properties": {
                "id": 99,
                "county": "Ashe",
                "cen_lat": 36.4343964583676,
                "cen_long": -81.5004915302458,
                "county_id": "5",
                "extent": "[-9099469.85881319,4333729.96758589,-9044051.86962052,4381852.80674575]"
            }

when I read extent and getting result is

"[-9099469.85881319,4333729.96758589,-9044051.86962052,4381852.80674575]"

but I need

[-9099469.85881319,4333729.96758589,-9044051.86962052,4381852.80674575]

How can I get?

Mit Jacob
  • 159
  • 1
  • 15
  • reformat the question.also what is that large number an array of numbers? is it an array of numbers? put your code between two back quotes. It's the same key as the tilde~ next to 1 – Train Dec 08 '17 at 21:04
  • 1
    [JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) – Paul Dec 08 '17 at 21:08
  • 1
    try JSON.parse then repost the question with the results of that. – Train Dec 08 '17 at 21:10
  • Possible duplicate of [JQuery get data from JSON array](https://stackoverflow.com/questions/15219435/jquery-get-data-from-json-array) – zod Dec 08 '17 at 21:11
  • No mention of jQuery in the question... – Andy Dec 08 '17 at 21:12
  • Found it. Convert JSON.parse – Mit Jacob Dec 08 '17 at 21:12
  • Remove _"caution"_ from?? What is "caution"? Do you meant you want to remove the _quotes_ `"` from it? JSON is all Strings, and I take it you want the actual _Array_ represented by `extent`. In your browser's console, try `JSON.parse("[-9099469.85881319,4333729.96758589,-9044051.86962052,4381852.80674575]");` – Stephen P Dec 08 '17 at 21:16

1 Answers1

0

As stated in the comments.

JSON.parse("[-9099469.85881319,4333729.96758589,-9044051.86962052,4381852.80674575]");

Train
  • 3,420
  • 2
  • 29
  • 59