This one also works
console.log(Object.keys(Object.fromEntries([["1", 2],["3", 2],["6", 2]])))
In this example, Object.fromEntries will create an object from an array of key/value pairs - it will take the first element as a key, and the second element as the value - creating something like this:
{
"1": 2,
"3": 2,
"6": 2
}
Then, Object.values will grab the keys of the object, thus, removing the values and retaining the keys, giving the desired output.
P/S: just added another way to do this
console.log(Array.from([["1", 2],["3", 2],["6", 2]], x=>x[0]))