What is the fastest and safest way to convert ANY type variable to String in JavaScript?
<p>Any thoughts on function that will receive one argument and returns back by string representation of the argument in JavaScript?</p>

<p>If the given object implements .toString(), then the function should use it.  Otherwise, the function can rely on what the JavaScript implementation offers.</p>

<p>So what I come up with is like this.</p>

<pre><code>var convert = function (arg) {
  return (new String(arg)).valueOf();
}
</code></pre>
