I wanted to implement the sleep sort algorithm, but I can't use
VA = [4, 2, 5, 7];
for(x=0; x<VA.length; x++) {
var y = VA[x];
setTimeout('console.log(' + y + ')', y*1000);
}
it tells me I can't use "var". And when I remove that I get some syntax error.
Any nice alternative way to implement a sleep sort in coffescript?