Book = function (publisher, subject, publishYear) {
  this.publisher = publisher;
  this.subject = subject;

  var publishYear = publishYear;

  this.IsSubjectDotNet = function() {
    return (this.subject.indexOf('NET') !== -1);
  }

  this.IsBookNewAndCool = function() {
    return (WasPublishedThisYear() && this.IsSubjectDotNet ());
  }

  WasPublishedThisYear = function () {
    var currdate = new Date();
    return (currdate.getFullYear() === publishYear);
  }
}

var myFinalBook = new Book('A&W', '.NET', 2007);

alert (typeof(myFinalBook.WasPublishedThisYear) === "undefined"); // wyświetla true
alert (myFinalBook.IsSubjectDotNet());  // wyświetla true
alert (myFinalBook.IsBookNewAndCool()); // wyświetla false
