Do you know what will be the output of this code?
JavaScript
const obj = { b: 1, 2: "x", a: 2, 1: "y" };
console.log(Object.keys(obj));
Show answer and explanation
The answer is ["1", "2", "b", "a"].
Integer-like keys are listed first in numeric order. Other string keys follow in the order they were added.