Hi,

How can I sort an Object?

For example I have the following object:
{banana:"yellow", apple:"green", lemon:"yellow", cherry:"red"}

and I need to sort it so that it looks like this:
{apple:"green", banana:"yellow", cherry:"red", lemon:"yellow"}

I need to assign the colors in a for in loop, for which the order is important.

Thanks,
Claudia

Reply via email to