What goes in the blank?
// returns the keys of the object as an array
function keysOf(obj: Record<string, number>): string[] {
return Object.____(obj);
}
// keysOf({a:1,b:2}) -> ["a","b"]
Answer: keys
Object.keys() returns an array of the object property names.
Play Problem Solving ▸