Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const jonas = {
- firstName : "Jonas",
- lastName : "Schmonas",
- birthYear : 1991,
- job : "teacher",
- friends : ["Joe","Jim","Lou"],
- hasDriversLicense: true,
- calcAge : function(){
- return 2037 - this.birthYear;
- },
- getSummary : function(){
- return `${this.firstName} is a ${this.calcAge()}-year old ${this.job}, who has ${this.hasDriversLicense ? "a" : "no"} drivers license.`
- }
- };
- console.log(jonas.getSummary());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement