0

after an ajax request the original order is not preserved, I need to order this json by value:

{1: "c", 2: "a", 3: "b"}
Patrick Hund
  • 19,163
  • 11
  • 66
  • 95
Sairam Santana
  • 63
  • 1
  • 1
  • 7
  • This is pretty much just a request for us to write code for you, which is not what SO is for. Please do some research, try some things, and come back when you have a problem with the code that you write. – rmlan Jan 04 '18 at 16:47
  • why not use an array? – Nina Scholz Jan 04 '18 at 16:47
  • https://stackoverflow.com/questions/1359761/sorting-a-javascript-object-by-property-name – fuzzybear Jan 04 '18 at 16:47
  • Objects are not *ordered*, use an array instead. – ProEvilz Jan 04 '18 at 16:48
  • I have a problem with 'the original order is not preserved'... HTTP is all text, if you send "Hello Mendy" you will never get anything else than "Hello Mendy". It's not like one day you have a chance to get "Hedy Menllo" – fingeron Jan 04 '18 at 16:48
  • object `{}` properties don't have order, only array object `[]` values do – Slai Jan 04 '18 at 16:52

0 Answers0