Json Array

var orders = [ { "id": 5, "created": "2021-05-15T13:22:16.679697+05:30", "modified": "2021-05-15T14:59:11.141495+05:30", "label": "dfrf", "url_slug": null, "thumbnail": null, "icon": "icodn_1", "description": "sjksjhgsjg", "status": true, "category": 5 }, { "id": 2, "created": "2021-05-15T12:27:47.798769+05:30", "modified": "2021-05-15T12:27:47.798769+05:30", "label": "ewaste", "url_slug": null, "thumbnail": null, "icon": null, "description": null, "status": true, "category": 5 }, { "id": 3, "created": "2021-05-15T12:53:54.935037+05:30", "modified": "2021-05-15T12:53:54.935037+05:30", "label": "fan2", "url_slug": null, "thumbnail": null, "icon": "icon_1", "description": null, "status": true, "category": 5 } ] console.log(orders); var orderInfo = orders.map(order => { var info = { "label": order.label, "orderDesc": order.category } return info; }); console.log(orderInfo);

Comments

Popular posts from this blog

The maxlength attribute is not working with number

Convering object into Array