I am trying to resize the window from a given array of integers. Here is my current incorrect code:
$(window).load(function() {
var group = [0, 1, 2];
var global_i = 0;
$.each(group,function(i){
    //some code will execute here
    console.log('#');
    resize_window_width_helper(1000-(i*10));        
    $(window).on('debouncedresize.rs'+i, function() {   
        if(i == global_i){
            //execute another bit of code on resize
            console.log("Hello from " + i);
            console.log('body width = '+$('body').width());
            global_i++;
        }
    });
});
});
The return from my console is:
#
#
#
Hello from 0
body width = 941 
Hello from 1 
body width = 941 
Hello from 2 
body width = 941 
The return i was expecting is:
#
Hello from 0
body width = 961
#
Hello from 1
body width = 951
#
Hello from 2
body width = 941
The contents of the array group will vary.
The function resize_window_width_helper(input) will simply resize the window width to its argument value. 
The event debouncedresize is a fix for the Chrome browser firing off any resizes twice (see http://paulirish.com/2009/throttled-smartresize-jquery-event-handler/ and https://github.com/louisremi/jquery-smartresize#minimalist-standalone-version). So please treat this event as a simple $(window).resize(function() {...});. 
I am using the Google Chrome browser.
I strongly suspect the source of all my woes lies in the variable i and the method in which it is incremented. I deeply appreciate any help you can provide.