wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes missing name after . operator ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "missing name after . operator ?" Watch "missing name after . operator ?" New topic
Author

missing name after . operator ?

Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
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

Joined: Jan 10, 2002
Posts: 60774
    
  65

double is a JavaScript reserved word and cannot be used as a property name using the dot notation.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: missing name after . operator ?
 
Similar Threads
Round number to nearest quarter
dose increment operator works differently at different places?
reg cookies and its syntax..
Javascript not detecting argument passed by JSP code
question from Marcus Green's Mock Exam 3