Skip to content

Instantly share code, notes, and snippets.

@Quby
Quby / app.js
Created November 25, 2011 17:31 — forked from anonymous/gist:1394024
function factorize (x) {
for (var i = 2 ; i <= Math.sqrt(x) ; i++) {
if (x % i === 0) return [i].concat(factorize(x/i));
}
return [x];
}
function f (x) {
var numbers = [];
//Blocking scope
let(valuse){}
for(let values){}
//Tuples
(val1,val2)
//List expressions,range,reduce,guard
[a*a | list->a]
[1,3..33]
last = (new Date).getTime();
str = '';
for(a=0,b=0,c=0,d=0,f=0;a<1000,b<1000,c<1000,d<1000,f<1000;a++,b++,c++,d++,f++){
str += 'Number %0 %1 %2 %3 %4'.format(a,b,c,d,f);
}
print((new Date).getTime() - last)
last = (new Date).getTime();
str = '';
for(a=0,b=0,c=0,d=0,f=0;a<1000,b<1000,c<1000,d<1000,f<1000;a++,b++,c++,d++,f++){