javascript - How to break down an array of objects within a string -


i have code returns this:

body: '[     {         name: "name",         lastname: "lastname"     },     {         name: "name",         lastname: "lastname"     },     {         name: "name",         lastname: "lastname"     } ]' 

of course extracting body simple object.body however, rid of '' wraps array destroying me. tried doing object.body.slice(1,-1) rid of them, didnt work. i'm not using object properly.

how can "extract" array within body usable array?

with valid json string, parse string object json.parse, if have .

array = json.parse(string); 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -