I think that will work fine for the most part, but the problem is you can't be sure of what optimizations the browser is making (or will make in future builds of the browser) when using requestAnimationFrame - it's designed to allow browsers to do weird stuff to keep the loop in sync with the monitor, which isn't really what you want when processing game logic.
JS is of course single threaded but requestAnimationFrame can give browsers the option to batch stuff up and do it outside of the regular javascript execution - I don't know if any browsers actually do this but it's possible. The main thing is that if your rendering FPS is low due to a lot of elements/sprites/whatever on the screen, your game logic loop could potentially still be run at full speed while requestAnimationFrame stumbles along at a lower rate. End result being that you could actually increase your FPS, because the game logic isn't sitting around waiting as long between render frames to update.
Of course, setInterval doesn't guarantee a constant speed loop either, but it's at least designed to be as consistent as possible.
JS is of course single threaded but requestAnimationFrame can give browsers the option to batch stuff up and do it outside of the regular javascript execution - I don't know if any browsers actually do this but it's possible. The main thing is that if your rendering FPS is low due to a lot of elements/sprites/whatever on the screen, your game logic loop could potentially still be run at full speed while requestAnimationFrame stumbles along at a lower rate. End result being that you could actually increase your FPS, because the game logic isn't sitting around waiting as long between render frames to update.
Of course, setInterval doesn't guarantee a constant speed loop either, but it's at least designed to be as consistent as possible.
Here's a relevant article: http://www.chandlerprall.com/2012/06/requestanimationframe-i...