I’m having an each loop though the objects,
And in it, I create some images, and I want to put into them a data of the reference to an image from the last iteration.
For example:
.each((function(some_data){ return function(i, obj){
var prev='???'; // how do I retrieve the value from the last cycle?
var image=new Image();
image.data('prev',prev);
prev=image;
// how do I pass the value to next cycle?
}})(some_data));
Before your .each call, you define the variable in the outer scope..