How to convert json array to javascript array using specific values -


i want convert json array (string) javascript array using specific values. json array :

[{"id":47,"libelle":"famille de test"},{"id":1,"libelle":"geolocalisation"},{"id":4,"libelle":"outils"},{"id":2,"libelle":"proprete"},{"id":3,"libelle":"urgence"}] 

and want ["famille de test", "geolocalisation", ...] using libelle values. tried use $.map didn't work out.

the map implementation should work:

var jsonstr = '[{"id":47,"libelle":"famille de test"},{"id":1,"libelle":"geolocalisation"},{"id":4,"libelle":"outils"},{"id":2,"libelle":"proprete"},{"id":3,"libelle":"urgence"}]';  var arr = json.parse(jsonstr); var libelle = arr.map(function(x) { return x.libelle; }); 

Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -