I encountered a problem that the object I created is sorting the keys in alphabetical order. This sorting happens only in my React Native project not when I run usual js file or browser console.
let obj = {
b:1,
a:2
}
console.log(obj) // {"a": 2, "b": 1}
I tried using Map() and then converted to Object but still keys are sorting itself. What is the reason behind it and how to fix it?
Version: react-native-cli: 2.0.1 react-native: 0.66.2 node: v16.13.0