Treap in JS