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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "missing name after . operator ?" Watch "missing name after . operator ?" New topic

missing name after . operator ?

Luke Murphy
Ranch Hand

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

Joined: Jan 10, 2002
Posts: 60810

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]
Don't get me started about those stupid light bulbs.
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