title: Adding methods to prototype objects in JavaScript
body: <p>I'm making my way through <a href="https://www.murach.com/shop-books/web-development-books/murach-s-javascript-and-jquery-3rd-edition-detail" rel="nofollow noreferrer">Murach’s JavaScript and jQuery (3rd Edition)</a> and I've encountered a compiler error with code from the book. I've triple checked my syntax against the book's syntax and I think I can rule it out. I also looked at the <a href="https://www.murach.com/images/downloads/javascript_and_jquery_3rd_Ed/jqu3Correx.pdf" rel="nofollow noreferrer">errata page</a> and I don't find a reference to the page I'm on.</p>
  
  <p>I also looked at <a href="https://stackoverflow.com/questions/2149762/possible-cases-for-javascript-error-expected-identifier-string-or-number/2149815">this question</a>, but I didn't find anything applicable to my issue.</p>
  
  <p>Here is my object constructor:</p>
  
  <pre><code>var Invoice = function(subtotal, taxRate) {
      this.subtotal = subtotal;
      this.taxRate = taxRate;
  };
  </code></pre>
  
  <p>I run into trouble when attempting to add methods to the prototype object:</p>
  
  <pre><code>// The getTaxAmount method is added to the Invoice prototype
  Invoice.prototype.getTaxAmount: function() {
  // Compiler whines right here ^ and     ^
      return (subtotal * this.taxRate);
  };
  
  // The getInvoiceTotal method is added to the Invoice prototype
  Invoice.prototype.getInvoiceTotal: function() {
  // Compiler whines right here ^ and     ^
      return subtotal + this.getTaxAmount(this.subtotal);
  };
  </code></pre>
  
  <p>I'm using Visual Studio Code with Debugger for Chrome. The prompt in VS Code says it wants a <code>;</code> at the first spot it complains and <code>[js] identifier expected</code> at the second spot it complains.</p>
  
  <p>Thank you for reading. I welcome your suggestions.</p>