Wrox Programmer Forums
|
BOOK: JavaScript 24-Hour Trainer
This is the forum to discuss the Wrox book JavaScript 24-Hour Trainer Jeremy McPeak; ISBN: 978-0-470-64783-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: JavaScript 24-Hour Trainer 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 June 29th, 2011, 08:57 PM
Registered User
 
Join Date: Oct 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Variables syntax

On page 71 the following code shows ("") before the closing semicolon. I've seen this syntax used here and there in the text, but I'm not sure what it's for.

Code:
var stringParts = [
"John's family is: ",
family.join(", ")
];
var familylString = stringParts.join("");
 
Old June 29th, 2011, 09:55 PM
jmcpeak's Avatar
Wrox Author
 
Join Date: Nov 2005
Posts: 87
Thanks: 0
Thanked 18 Times in 17 Posts
Default

Howdy, inspiredmac.

I assume you're talking about the join("");. Well, the parentheses are there because it's executing the array object's join() method. The "" denotes empty text, so each element in the array is going to be concatenated together with no spaces between them.





Similar Threads
Thread Thread Starter Forum Replies Last Post
help syntax please khautinh SQL Server 2000 1 August 26th, 2006 02:47 AM
Syntax for Populating Variables rit01 ASP.NET 2.0 Professional 0 July 10th, 2006 04:28 AM
BCP Syntax jfleming SQL Server 2000 1 August 10th, 2005 12:28 PM
Syntax for bind variables in Pro*C Rhea_Raksha All Other Wrox Books 0 July 12th, 2005 09:22 AM
c# syntax msrnivas .NET Web Services 2 October 15th, 2004 01:26 AM





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