By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,255 Members | 1,701 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,255 IT Pros & Developers. It's quick & easy.

Expr syntax?, with { blah : foo }

P: n/a
I recently saw this type of expression, and not having seen it before,
does it imply somekind of an associative array or what ???

Is there documentation on this ? where ?
My normal JS resource sites would be
netscape
irt.org
drclue.net
javascript.internet.com
javascript.com
faqts.com KB JS category
Others Reference Links, gladly welcomed.

the expression actually had multiple entries

{ blah : foo,
achew : gazoontite }

Dec 1 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

in*****@rcn.com wrote:
I recently saw this type of expression, and not having seen it before,
does it imply somekind of an associative array or what ???

Is there documentation on this ? where ?
My normal JS resource sites would be
netscape
irt.org
drclue.net
javascript.internet.com
javascript.com
faqts.com KB JS category
Others Reference Links, gladly welcomed.

the expression actually had multiple entries

{ blah : foo,
achew : gazoontite }


The above expression is the syntax for creating an object literal which
is defined in ECMAScript v3. It allows you to create an object and
specify its properties. It consists of a comma-separated list of
colon-separated property/value pairs. So in your above expression, you
have an object with properties "blah" and "achew" whose corresponding
value is whatever the value of "foo" and "gazoontite" is at the time.

Dec 2 '05 #2

P: n/a

in*****@rcn.com wrote:

[snip]
Is there documentation on this ? where ?


Google on "JSON". (Javascript Object Notation).

Also see also 11.1.5 of the ECMA specification:-

<URL:http://www.ecma-international.org/publications/standards/Ecma-262.htm>

Regards

Julian Turner

Dec 2 '05 #3

P: n/a
in*****@rcn.com wrote:
[...]
Others Reference Links, gladly welcomed.

the expression actually had multiple entries

{ blah : foo,
achew : gazoontite }
It's called an initializer:

<URL:
http://devedge-temp.mozilla.org/libr...j.html#1008327


--
Rob
Dec 2 '05 #4

P: n/a
in*****@rcn.com wrote:
[...]
My normal JS resource sites would be
netscape
Netscape DevEdge <URL:http://devedge.netscape.com/> is long gone.
Find some of it at <URL:http://mozilla.org/js>,
<URL:http://devedge-temp.mozilla.org/index_en.html> (temporary!)
and <URL:http://developer.mozilla.org/>, or use Web archives like
<URL:http://web.archive.org/>.
irt.org
drclue.net
javascript.internet.com
javascript.com
[...]


I do not know about the rest that is cited here, but drclue.net
is definitely not to be recommended as JS resource, or any other
technique used on the Web for that matter.
PointedEars
Dec 2 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.