Comment

Comment by shortrounddev2

Doesn't work on types, only instantiated objects with values for those keys:

  class Foo {
    foo: number | undefined;
    bar: string | undefined;
  };

  console.log(Object.keys(Foo));      // prints []
  console.log(Object.keys(new Foo));  // prints []

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton