[Python-ideas] Javascript Destructuring Assignment

Delaney, Timothy (Tim) tdelaney at avaya.com
Tue Mar 6 23:10:55 CET 2007


Brett Cannon wrote:

>> Are you assuming variable-length skips, so that
>> 
>>     [a,,b] = [1,2,3,4,5]   would mean a=1;b=5 ?
>> 
> 
> Yep, that's how I read it.

I read it differently. I'm think you need to have a comma for each
skipped element:

    [a,,,b] = [1,2,3,4,5]

Anyone with in-depth knowledge, or FireFox 2.0 available to test this?

Tim Delaney



More information about the Python-ideas mailing list