Code QuizAdvanced

typeof Type Operator

Deriving a type from a runtime value requires the typeof type operator.

Codetypescript
const defaults = {
  host: "localhost",
  port: 8080,
};

type Config = defaults;

function connect(cfg: Config) {
  console.log(cfg.host, cfg.port);
}

What is the bug in this code?