Now both safari and opera show the same key order. Unfortunrately, sort uses alphabetical order to sort keys. so key 7 (Android 2.1) comes *after* key 18 (Android 4.3).

The trick is to pass a compare function to sort. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort