array slice syntax

Stefan Gössner stefan at goessner.net
Thu Aug 16 10:07:55 PDT 2007


Hello,
here are my first questions after following the list quite a while.

1. I really like the array slice syntax [start:end:step] described in
http://developer.mozilla.org/es4/proposals/slice_syntax.html

The description seems to miss the case, where 'start' is greater than 'end'.

a[5:2]

Will
(a) 'step' be implicitely set to -1 ?
(b) an empty array come as result ?
(c) an error occur ?

2. The descendant operator '..' is mentioned only in the tutorial 
introduction.
http://developer.mozilla.org/es4/spec/chapter_1_tutorial_introduction.html
I could not find it mentioned elsewhere.

Is it also considered to work with array notation as in:

y..[0]   // access the first element of all arrays of 'y' and it's 
descendants.

--
Stefan











More information about the Es4-discuss mailing list