functional js trampoline