‹ Commute from Simi Valley to Brentwood •
Stupid Code Tricks:
Ruby http://www.ruby-doc.org/docs
foo, bar = [1, 2]
PHP http://www.php.net/manual/en
list($foo, $bar) = array(1, 2);
JavaScript http://developer.mozilla.org
[foo, bar] = [1, 2]; // I believe this is only valid in the latest versions of Firefox.
Tags: web-programming

No comments
Comments feed for this article
Trackback link
http://artlung.com/blog/2007/02/21/destructured-assignment-in-ruby-php-and-javascript/trackback/