prototype based class

by John Kiran

JavaScript

let User=function (name) {
		  this.name=name
  };
  
	User.prototype.show= function() {return ("Hi "+this.name);};
  
	let user=new User("John");
  
	console.log(user);
	console.log(user.name);
	console.log(user.show());
	console.log(user.__proto__.show());
  console.log(user.__proto__==user.prototype);