title: Find JS class itself in array
body: <pre><code>const Myclass = function(n) {
     this.name = n;
     this.getIndex= function(array) {
        //how to return array index
     }
     this.getName= function() {
        return this.name;
     }
  }
  
  var array = [];
  
  array[1] = new Myclass('Eminem');
  array[2] = new Myclass('ugly boy');
  array[10] = new Myclass('Slim Shady');
  
  /// will shuffle this array (randomly change indexes)
  
  for(let i in array) {
    (function(_i){    
         console.log('My name is '+_i.getName()+ ' I\'am sitting at index '._i.getIndex(array))
    })(array[i])
  }
  </code></pre>
  
  <p>How can i get index of this class instance in array?</p>