I am trying to pass an integer value i to callback, which is not working as expected since i is available as reference.
for (var i = this.texturesPath.length - 1; i >= 0; i--) {
var textureIndex = i;
loader.load(baseTexturePath + this.texturesPath[i], function(texture) {
scope.textures[textureIndex] = texture;
});
What is the solution/approach for this scenario?