When I run test.loop() it only executes once instead of at the expected rate. Any ideas what I can do to fix this?
"use strict;"
var test = function(options) {
this.options = options;
return this;
};
test.prototype = {
'loop': function() {
console.log('test');
if (this !== window) {
requestAnimationFrame(this.loop);
}
}
};
test.loop();