title: Math.random().toString.slice is not a function in Javascript
body: <p>I'm trying to set up a custom directive on Vue JS 2. But I got this error message:</p>
  
  <pre><code>TypeError: Math.random(...).toString.slice is not a function
  </code></pre>
  
  <p>Here is my directive written globally on main.js:</p>
  
  <pre><code>Vue.directive('rainbow', {
    bind (el, binding, vnode) {
      el.style.color = '#' + Math.random().toString.slice(2, 8)
    }
  })
  </code></pre>
  
  <p>Here is where I'm calling my directive</p>
  
  <pre><code>&lt;h2 v-rainbow&gt;Hello&lt;/h2&gt;
  </code></pre>
  
  <p>I searched everywhere on the web but info.
  Any help or suggestions is more than welcome. Thx</p>