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

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

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

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

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

myFinalBook.WasPublishedThisYear();

Book.prototype.toArray = function() {
  return [this.publisher, this.subject];
}
// wyświetla 2
alert (myFinalBook.toArray().length);

alert (myFinalBook.IsSubjectDotNet());  // wyświetla true
alert (myFinalBook.IsBookNewAndCool()); // wyświetla false
