From: Jorge on
On Mar 11, 7:08 pm, Dr J R Stockton <reply1...(a)merlyn.demon.co.uk>
wrote:
>
> You could also, in at least one browser, delete it with the delete
> operator (check legality).

Which browsers do you know in which the delete operator is either
broken or illegal ?

javascript:var a=[1,2,3]; alert(delete a[1]+", ["+a+"]");
--
Jorge.
From: Dr J R Stockton on
In comp.lang.javascript message <d4a9a1b1-935d-4f3c-a327-f229131c601c(a)d2
g2000yqa.googlegroups.com>, Thu, 11 Mar 2010 13:20:27, Jorge
<jorge(a)jorgechamorro.com> posted:
>On Mar 11, 7:08�pm, Dr J R Stockton <reply1...(a)merlyn.demon.co.uk>
>wrote:
>>
>> You could also, in at least one browser, delete it with the delete
>> operator (check legality).
>
>Which browsers do you know in which the delete operator is either
>broken or illegal ?
>
>javascript:var a=[1,2,3]; alert(delete a[1]+", ["+a+"]");

None. Have you considered studying EFL?

I tested in one browser, in accordance with what you quoted. I did also
glance at the relevant ECMA 262 section. If the OP needs to know more,
he can find it out. YWII.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (RFCs 5536/7)
Do not Mail News to me. Before a reply, quote with ">" or "> " (RFCs 5536/7)
From: Jorge on
On Mar 12, 8:14 pm, Dr J R Stockton wrote:
> Thu, 11 Mar 2010 13:20:27, Jorge posted:
> >On Mar 11, 7:08 pm, Dr J R Stockton wrote:
>
> >> You could also, in at least one browser, delete it with the delete
> >> operator (check legality).
>
> >Which browsers do you know in which the delete operator is either
> >broken or illegal ?
>
> >javascript:var a=[1,2,3]; alert(delete a[1]+", ["+a+"]");
>
> None. (...)

And why did you say "in at least one browser" and "check legality" ?
--
Jorge.
From: Hans-Georg Michna on
Interesting discussion. It leaves the question whether it would
be good programming style to utilize the difference between a
nonexistent property and a property that has been set to
undefined or null.

I tend to think it is not, mostly because it would make a
program a tad more difficult to understand and also because it
is difficult to make sure that all browsers conform.

On the other hand there may be pieces of code in which utilizing
this difference would allow higher performance.

Hans-Georg
From: Stefan Weiss on
On 10/03/10 17:35, Lasse Reichstein Nielsen wrote:
> SAM <stephanemoriaux.NoAdmin(a)wanadoo.fr.invalid> writes:
>> My Firefox tells me 'undefined' for all that alerts :
>>
>> var b = [1,2,,4,5];
>> alert(b[2]);
>
> Yes, reading a non-existing property yields the undefined value.
> This is no different from doing:
> var x = new Object();
> alert(x.arglebargle);
> The object x has the property "arglebargle", so trying to read
> it yields undefined.

Aside, because it just came up on the JSLint mailing list: when strict
warnings are enabled in Firefox, trying to access x.arglebarle will
trigger a warning, but accessing a nonexistent array index will not. I'm
not sure if that's very logical or consistent.


--
stefan