Tower-of-Hanoi in JavaScript