February 21st, 2007
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.
Comments Open; Trackbacks Open:
http://artlung.com/blog/2007/02/21/destructured-assignment-in-ruby-php-and-javascript/trackback/
http://artlung.com/blog/2007/02/21/destructured-assignment-in-ruby-php-and-javascript/trackback/
