swap two numbers  [ 672 views ]

Goal: to enjoy he beauty of out of box thinking

Everyday task to swap two numbers. Nothing easier like this, but do it in one line. The trickiest solution I have ever seen:

var a = 1, b = 23;

ok, swap them

b = [a, a = b][0];

this is it, simple beautiful

#sidebar a { color:#fff; } #sidebar ul ul li { color: #DEF585; } #sidebar h2 { color: #fff; } #sidebar ul p, #sidebar ul select { color: #BEDDBE; } #backfly { background: url(images/golfBallWallPaper.jpg) left bottom fixed repeat-x #65a51d; }