Heap in JS