How to make a callback funciton to a drupal behaviors funtion I have this Drupal behaviors function:

(function ($) {




    Drupal.behaviors.modulenameSwiper = {
        attach : function (context, settings) {
        if ( location.pathname != '/en/imce' ||              location.pathname != '/fr/imce' ||              location.pathname != '/it/imce'     ) {

        var mySwiper = new Array();
        var mySwiperIndex = 0;

        $('.swiper-container').each(function (){
          mySwiper[mySwiperIndex] = new Swiper ($(this)[0],{
              mode:'horizontal',
              loop: false, 
              slidesPerView: 'auto'
              });
          });

          mySwiperIndex++;

    }
    }
  }
 }(jQuery));


I need to call mySwiper object out of the Behaviors callback. there is anyway to make it?
You could assign mySwiper to a property within the behavior.

(function ($) {
  Drupal.behaviors.modulenameSwiper = {
    attach : function (context, settings) {
      if ( location.pathname != '/en/imce' || location.pathname != '/fr/imce' ||              location.pathname != '/it/imce'     ) {
        mySwiper = this.get();
        $('.swiper-container').each(function (){
          mySwiper.instances[mySwiper.index] = new Swiper ($(this)[0],{
            mode:'horizontal',
            loop: false, 
            slidesPerView: 'auto'
          });
        });
      }
    },
    /**
     * Returns an object with Swiper instances and highest index.
     */
    getSwipper : function () {
      if (this.mySwiper === 'undefined') {
        this.mySwiper.instances = new Array();
        this.mySwiper.index = 0;
      } else {
        this.mySwiper.index++;
      }
      return this.mySwiper;
    },
  };

  $(document).ready(function () {
    console.log(Drupal.behaviors.modulenameSwiper.getSwiper());
  });
}(jQuery));