Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Employee = function(firstName,lastName,age){
- this.firstName = firstName;
- this.lastName = lastName;
- this.age = age;
- };
- Employee.prototype.getFullName= function(){
- console.log(this.firstName+" "+this.lastName);
- };
- const person = new Employee("Ayan","Upadhaya",28);
- console.log(person.age);
- person.getFullName();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement