title: Get number of digits with JavaScript
body: <p>As the title of my post suggests, I would like to know how many digits <code>var number</code> has. For example: If <code>number = 15;</code> my function should return <code>2</code>. Currently, it looks like this:</p>
  
  <pre><code>function getlength(number) {
    return number.toString().length();
  }
  </code></pre>
  
  <p>But Safari says it is not working due to a <code>TypeError</code>:</p>
  
  <pre><code>'2' is not a function (evaluating 'number.toString().length()')
  </code></pre>
  
  <p>As you can see, <code>'2'</code> is actually the right solution. But why is it <code>not a function</code>?</p>