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_Official
yahoogroups.com, Alligator
<alligator_666
...> wrote:
>
> 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
...> 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_Official
yahoogroups.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]" 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]
>