I used the script from https://bl.ocks.org/gkhays/c58a109172d543ee095e57f0eb3606f2# to create an animation of an oscillating sine wave but I want to display 2 sine waves and eventually 4 so I need to pass an argument to window.requestAnimationFrame() I was able to get the first variable to be passed working but when I called window.requestAnimationFrame again and passed a new variable, it stopped working. If I call requestAnimationFrame again by uncommenting the following line, it doesn’t work any more: