function Character(name, age, hobby) {
this.name = name;
this.age = age;
this.hobby = hobby;
}
Character.prototype.bio = function() {
return `Hi there, I'm ${this.name}, a ${this.age}-year-old who loves working with ${this.hobby}!`;
}
Character.prototype.interests = ['programming', 'workout', 'hanging out with friends'];
const sourav = new Character('Sourav', 16, 'Node.js');
console.log(sourav.bio());
console.log(`My interests include: ${sourav.interests.join(', ')}.`);
-
Notifications
You must be signed in to change notification settings - Fork 4
souravkl11/souravkl11
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published