Code QuizIntermediate

Public Parameter Property

Find why the shorthand public parameter property doesn't work here.

Codetypescript
class Point {
  constructor(public x: number, y: number) {}
}

const pt = new Point(1, 2);
console.log(pt.x + pt.y);

What is the bug in this code?