← BYTES
JavaScript·Starter·Ref: 3.1.12

What does `Object.keys({a: 1, b: 2})` return?

Have a question about this video? Mention reference 3.1.12 when you contact us.

a.[1, 2]
b.{a: 1, b: 2}
c.["a", "b"]
d.2
`Object.keys()` returns an array of a plain object's own enumerable property names (as strings), in this case the two keys "a" and "b"; `Object.values()` returns the corresponding values instead.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES3112#JavaScript