 like this: class User {     name: string;      doConsole(): void {         console.log(`Name: ${this.name}`);     } }  let userObj = { name: 'jose' };  let user = new User(); Object.assign(user, userObj);  user.doConsole();  