• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

missing name after . operator ?

 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This is from the book 'Javascript the good parts'.



I have replaced the document.writeln() with print() so that I can run it in eclipse with rhino.

When I try to run it, I get:

js: line 24: missing name after . operator
js: myObject.double = function () {
js: ...............^
js: line 32: syntax error
js: };
js: ^
js: line 34: missing name after . operator
js: myObject.double();
js: ...............^


Any ideas?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65122
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
double is a JavaScript reserved word and cannot be used as a property name using the dot notation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic