Forum Discussion

sjakathi's avatar
sjakathi
New Contributor II
5 years ago

How to Sort an Array Based on Key/Column name

Hi ,

I have an array which i want to sort it by the keys/column.
{
array1:[
{
" Width":“4”
" Length":“5 "
" Item Desc”:"Black ",
" Item ":"Pen "

  },

{
   "Width":"5"
  " Length":"7 "
   " Item Desc":"Blue ",
   " Item ":"Pen " ,
 }
]

}
Output:-
{
array1:[
{
" Item ":“Pen " ,
" Item Desc”:"Black “,
" Length”:“5 "
" Width”:“4”
},

{
   " Item Desc":"Blue ",
   " Item ":"Pen " 
    " Length":"7 "
    "Width":"5"
  }

2 Replies