473,320 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Expr syntax?, with { blah : foo }

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
4 1085

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

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
by: Moosebumps | last post by:
Does anyone here find the list comprehension syntax awkward? I like it because it is an expression rather than a series of statements, but it is a little harder to maintain it seems. e.g. you...
41
by: John Marshall | last post by:
How about the following, which I am almost positive has not been suggested: ----- class Klass: def __init__(self, name): self.name = name deco meth0: staticmethod def meth0(x):
8
by: Michael Press | last post by:
I have not written python codes nor run any. I saw this code posted and decided to try it. It fails. I read the tutorial and the entry for the built in function sum, but still do not see the...
0
by: Lew | last post by:
xahlee@gmail.com wrote: Blah, blah, blah. Plonk. -- Lew
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.