Multiple variable assignment in Javascript

I've been searching for a way to assign values to multiple variables from an array. This is very easy to achieve on Python where you can do something like: fam, giv, add, pre, suf = 'Swanson;Graham;Rudolf;Dr.;MD'.split(';') But I haven't found a solution in Javascript. I've tried: var [fam, giv, add, pre, suf] = 'Swanson;Graham;Rudolf;Dr.;MD'.split(';'); Which works in Firefox but not in Chrome var (fam, giv, add, pre, suf) = 'Swanson;Graham;Rudolf;Dr.;MD'.split(';'); Which doesn't work in Firefox. So I give in and try with two-liners instead: var fam, giv, add, pre, suf; (fam, giv, add, pre, suf) = 'Swanson;Graham;Rudolf;Dr.;MD'.split(';'); or var fam, giv, add, pre, suf; fam, giv, add, pre, suf = 'Swanson;Graham;Rudolf;Dr.;MD'.split(';'); But none if them works. Finally I tried: var tmpnam = 'Swanson;Graham;Rudolf;Dr.;MD'.split(';'); var fam=tmpnam[0], giv=tmpnam[1], add=tmpnam[2], pre=tmpnam[3], suf = tmpnam[4]; Which works in Firefox, Chrome and rekonq (KDE WebKit based browser). Is it really not possible to do one-line variable assignment like that in Javascript?

Flattr this!