$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · medium · #121

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 (also accepted: keys, keys())

Object.keys() returns an array of the object property names.
Play Problem Solving ▸