001
002const theFirm = {
003 title: 'The Firm',
004 author: 'John Grisham',
005 yearOfRelease: 1991,
006 getYearOfRelease() {
007 return this.yearOfRelease;
008 },
009 introduceAuthor(message) {
010 return `${this.author} ${message}`;
011 },
012};
013
014console.log(theFirm.getYearOfRelease());
015
016const theDaVinciCode = {
017 title: 'The Da Vinci Code',
018 author: 'Dan Brown',
019 yearOfRelease: 2003,
020};
021
022console.log(theFirm.getYearOfRelease.call(theDaVinciCode));
023
024
025
026console.log(theFirm.introduceAuthor('has written a total of 100 books'));
027
028console.log(theFirm.introduceAuthor.call(theDaVinciCode, 'is an American author best known for this thriller novels'))
029