方法类方法和原型之间有什么区别?

请参阅下面的示例代码,请在下面提及的问题中解释我的问题!

class User{
  constructor(email,name){
    this.email = email;
    this.name = name;
  }
  
  login(){
    console.log(this.email);
  }
}

var u1 = new User("dil@gm.com","dil");
u1.login();
class User{
  constructor(email,name){
    this.email = email;
    this.name = name;
  }
  
 User.prototype.login = function(){
console.log(this.email);
}
}

var u2 = new User("dil@gm.com","dil");
u2.login();

它们上面的两种编码类型有什么区别?我的意思是当两个实例都访问这些方法时,正常的方法声明和原型减速?