user824232
user824232

Reputation: 83

Javascript Array [Possibly Length?] Issue

Folks,

I have this array:

var list = new Array('Archer','Archer','Banker','Lantern','Toryboy','The Barb','Tim 
Whiffler','Glencoe','Warrior','Nimblefoot','The Pearl','The Quack','Don 
Juan','Haricot','Wollomai','Briseis','Chester','Calamia','Darriwell','Grand 
Flaneur','Zulu','The Assyrian','Martini-Henry','Malua','Sheet 
 Anchor','Arsenal','Dunlop','Mentor','Bravo','Carbine','Malvolio','Glenloth','Tarcoola','Pat
ron','Auraria','Newhaven','Gaulus','The Grafter','Merriwee','Clean 
Sweep','Revenue','The Victory','Lord Cardigan','Acrasia','Blue 
Spec','Poseidon','Apologue','Lord Nolan','Prince Foote','Comedy King','The 
Parisian','Piastre','Posinatus','Kingsburgh','Patrobas','Sasanof','Westcourt','Night 
Watch','Artilleryman','Poitrel','Sister Olive','King 
Ingoda','Bitalli','Backwood','Windbag','Spearfelt','Trivalve','Statesman','Nightmarch','Pha
r Lap','White Nose','Peter Pan','Hall Mark','Peter Pan','Marabou','Wotan','The 
Trump','Catalogue','Rivette','Old Rowley','Skipton','Colonus','Dark 
Felt','Sirius','Rainbird','Russia','Hiraji','Rimfire','Foxzami','Comic 
Court','Delta','Dalray','Wodalla','Rising Fast','Toparoa','Evening Peal','Straight 
Draw','Baystone','Macdougal','Hi Jinx','Lord Fury','Even Stevens','Gatum Gatum','Polo 
Prince','Light Fingers','Galilee','Red Handed','Rain Lover','Rain Lover','Baghdad 
Note','Silver Knight','Piping Lane','Gala Supreme','Think Big','Think Big','Van der 
Hum','Gold and Black','Arwon','Hyperno','Beldale Ball','Just A Dash','Gurner's 
Lane','Kiwi','Black Knight','What A Nuisance','At Talaq','Kensei','Empire 
Rose','Tawrrific','Kingston Rule','Lets Elope','Subzero','Vintage 
Crop','Jeune','Doriemus','Saintly','Might and Power','Jezabeel','Rogan 
Josh','Brew','Ethereal','Media Puzzle','Makybe Diva','Makybe Diva','Makybe 
Diva','Delta Blues','Efficient','Viewed','Shocking','Americain');

It is throwing an error. I have tried it in multiple browsers. Firefox Web Developer error console for example says Missing ")" after argument list.

Google Chrome says Uncaught Syntax Error - Unexpected identifier and interestingly has a formatting change after Russia (cold war conspiracy theory anyone?) in the list.

Upvotes: 0

Views: 73

Answers (2)

You should declare like following to avoid the appostrophy error like "x's".

var arlene2 = new Array("First element", "Second", "Last");

refer to Declare an array in Javascript

Upvotes: 0

Alex K.
Alex K.

Reputation: 175776

You need to change the entry

'Gurner's Lane'

to

'Gurner\'s Lane'

or

"Gurner's Lane"

An IDE with syntax colouring would make the broken quotation obvious (in fact just like SO highlighting).

Upvotes: 5

Related Questions