List Info

Thread: Re: Re: IE and arrays




Re: Re: IE and arrays
user name
2007-10-11 13:10:19

I know that would definitely work... however that's not the point I was trying to make.
The construct I was trying to use might be useful in some specific situations... besides most (if not all) Dynamic Languages allow you to do such thing.
That's why I originally coded it that way when developing using Firefox as my testing browser, however IE does not allow it. So, I was wondering is this was another "feature" of IE, or it is the language itself that does not allow a construct like this?

Regards

Alligator_666
http://www.vicxsite.com/

nexus500 < nexus500%40yahoo.com">nexus500yahoo.com> wrote: why don't you just create an array in a normal way:
var v = f2();
and then call for alert(v[0] + ' ' + v[1]);

--- In JavaScript_Official%40yahoogroups.com">JavaScript_Officialyahoogroups.com, "Alligator"
<alligator_666...> wrote:
>
> Hello everybody,
> I have a very peculiar problem with arrays returned from a function.
>
> The problem is reproducible with the following code:
>
> function f1() {
> var v1, v2;
> [v1, v2] = f2();
> alert(v1 + ' ' + v2);
> }
>
> function f2() { return ['X', 'Y']; }
>
>
> When you call f1 in Firefox you get the alert box with "X Y" as
> expected, however the same does not work in IE and I get a "Cannot
> assign to [object]&quot; error message instead.
>
> Have any of you ran into a similar problem?
>
> Thanks
>
> Alligator_666
>





---------------------------------
Don't let your dream ride pass you by. Make it a reality with Yahoo! Autos.

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
Re: Re: IE and arrays
country flaguser name
United States
2007-10-11 20:22:01

On 10/11/07, Alligator < alligator_666%40yahoo.com">alligator_666yahoo.com> wrote:
&gt; So, I was wondering is this was another "feature" of IE, or it is the language itself that
>; does not allow a construct like this?

The language itself has different features between its versions, take
a look on the last version proposed by the author and you'll see weird
constructors inherited from languages like Ruby or Python. Besides the
fact that IE supports "JScript" while other browsers support
"JavaScript", each browser support a different engine of it, currently
IE doesn't support these new set of features of the language, so don't
try to use them if you plan to keep compatibility.

--
Jonas Raoni Soares Silva
http://jsfromhell.com
http://www.contraacpmf.com.br

__._,_.___
.

__,_._,___
Re: IE and arrays
country flaguser name
United States
2007-10-13 02:34:20

well, as you know, IE and FF in fact implement different versions of
what is called ECMAScript (JScript and JavaScript). So, probably
you're right in both cases, it's a 'feature' and it's a language
(JScript) itself. I guess you gotta read language specs to find out more.
goodluck

--- In JavaScript_Official%40yahoogroups.com">JavaScript_Officialyahoogroups.com, Alligator
<alligator_666...> wrote:
&gt;
> I know that would definitely work... however that's not the point I
was trying to make.
&gt; The construct I was trying to use might be useful in some specific
situations... besides most (if not all) Dynamic Languages allow you to
do such thing.
&gt; That's why I originally coded it that way when developing using
Firefox as my testing browser, however IE does not allow it. So, I was
wondering is this was another "feature" of IE, or it is the language
itself that does not allow a construct like this?
&gt;
>
> Regards
>
>
> Alligator_666
> http://www.vicxsite.com/
>;
>
> nexus500 <nexus500...> wrote: why
don't you just create an array in a normal way:
>; var v = f2();
&gt; and then call for alert(v[0] + ' ' + v[1]);
&gt;
> --- In JavaScript_Official%40yahoogroups.com">JavaScript_Officialyahoogroups.com, "Alligator"
> <alligator_666> wrote:
&gt; >
>; > Hello everybody,
> > I have a very peculiar problem with arrays returned from a function.
> >
> > The problem is reproducible with the following code:
&gt; >
> > function f1() {
> > var v1, v2;
> > [v1, v2] = f2();
&gt; > alert(v1 + ' ' + v2);
>; > }
> >
> > function f2() { return ['X', 'Y']; }
> >
> >
> > When you call f1 in Firefox you get the alert box with "X Y" as
> > expected, however the same does not work in IE and I get a "Cannot
> > assign to [object]&quot; error message instead.
> >
> > Have any of you ran into a similar problem?
> >
> > Thanks
&gt; >
> > Alligator_666
> >
>;
>
>
>
>
>
> ---------------------------------
> Don't let your dream ride pass you by. Make it a reality with
Yahoo! Autos.
>
> [Non-text portions of this message have been removed]
>

__._,_.___
Recent Activity
Visit Your Group
New business?

Get new customers.

List your web site

in Yahoo! Search.

Yahoo! Groups

Get info and support

on Samsung HDTVs

and devices.

Yoga Groups

Find Enlightenment

&amp; exchange insights

with other members

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )