Hi I am migrating few code from php to javascript.
I saw a strange behavior in sorting array of elements based on key.
Here\'s my php way