there are a lot of places (e.g. How to use requestAnimationFrame?) that fix window.requestAnimationFrame
as below. I do not understand why the right hand side of the assignment is wrapped in to a function call.
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(callback){
window.setTimeout(callback, 1000 / 60);
};
})();