I have a JsonArray something like this.
var json_array = [{ "text": "id", "size": 4}, { "text": "manifesto", "size": 4}, { "text": "also", "size": 4}, { "text": "leasing", "size": 4}, { "text": "23", "size": 4}];
Is there anyway to get me all the "text" property of this json_array in another array using Javascript/jQuery?
like:
var t_array = ["id","manifesto","also"....]
You can use $.map() to project the relevant information from your existing array into a new one:
var t_array = $.map(json_array, function(item) {
return item.text;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With