View Full Version : Structures like 'win95:"blabla",win98:"albalb"'

03-23-2005, 08:12 AM
I've seen such a javascript constuction already not once, and I can't find any documentation on this feature.
The exact javascript code is e.g.:

var _q4W={win95:_XX("zlqgrzv#<83"),win98:_XX(" qvlw {(A@8"),winme:_XX("zlq<{#71<33"),win2000:_XX("{mrhs{w$rx$9244"),winxp:_XX("ykpfqyu\"pv\"7032"),winnet:_XX("xjoepxt!ou!6/31"),winnt:_XX("zlqgrzv#qw3"),linux:_XX("tqv}!8"),macosx:_XX("pdf#rv#{3"),macppc:_XX("rfh%>35")};

where _XX is a function defined earlier.
So the question is: is this any sense in such a constructions and (if yes ) how it should be used?
Should a javascript parser (which I'am developing) support such a syntax or it should generate errors (or maybe just ignore)?
Thank you for help

03-23-2005, 09:05 AM

03-23-2005, 09:10 AM
That is called object literal. Read these links to get more info on this.


jkd beat me to it. :o

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum