what are the basic logic about this code

what are the basic logic about this code

 i get totally confused this alert call one time how ?

               var i = 0;
 function call(name) {
                if (i === 0) { 
                  setTimeout(function () {
                   alert(name); 
                    i = 0 
                  }, 1000); 
                } i++; 
              } 
            call('as'); 
            call('as1');
            call('as'); 
            call('as1')