hanoi javascript