add indexBy js method