Wrox Programmer Forums
BOOK: JavaScript Programmer's Reference
This is the forum to discuss the Wrox book JavaScript Programmer's Reference by Alexei White ISBN: 978-0-470-34472-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: JavaScript Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 8th, 2010, 08:19 PM
Registered User
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Is the parenthesees necessary?

I'm on page 121, simulating private methods, JavaScript, Programmer's Reference, and I was just wondering if the parentheses on line 7 before the function is imperative. Is it just for illustrative purposes? I'm just curious because the code runs both ways, with and without the parentheses.

I'm new to this, but I'm grasping on to the concepts pretty fast, but just so I completely understand the style and not get lost, I was just curious about this one thing.

Thank you.
Old January 10th, 2010, 12:51 PM
Friend of Wrox
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts

That's a fairly technical question about what's really going on inside Javascript, so I'm not sure. But when in doubt I do exactly what you did. Test it.

Based on the results, a good working answer is that they're not required. ;)

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.