title: How to make Vue Filter recursive?
body: <p>I had a function that i needed to use in different components so I decided to make a vue Filter. The problem is that the function is recursive, it's call itself, but I don't know how to do in a Vue Filter.</p>
  
  <p>In fact, I solved the issue, but I am not really satisfied with my solution, in the parameters of the filter I give the instance of vue and then call one more time the filter from the given instance...</p>
  
  <pre><code>-- component.vue
  if (this.$options.filters.arraysAreEquals(array1, array2, this)) {
      console.log("Arrays are equals")
  }
  
  
  -- main.js
  Vue.filter('arraysAreEquals', (x, y, self) =&gt; {
      if(x.length != y.length){
          return false;
      }
      if(x instanceof Array) {
          if(!(y instanceof Array)){
              return false;
          }
          for(let i = 0; i &lt; x.length; i++) {
              if(!self.$options.filters.arraysAreEquals(x[i], y[i], self)){
                  return false;
              }
          }
      } else {
          return x == y;
      }
  });
  </code></pre>
  
  <p>So my question is <strong>how</strong> can I should do the recursion without giving the vue instance (<code>self</code> in my case)? Thanks you.</p>