Code QuizIntermediate

Initializing Constructor Parameters

Find why the constructor value never reaches the instance property.

Codetypescript
class User {
  name: string;

  constructor(name: string) {
    name = name;
  }
}

const u = new User("Ada");
console.log(u.name);

What is the bug in this code?