× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Quick conversions - javascript

Errietta Kostala
Nov 14, 2015
<ul> <li>number -&gt; boolean (1/0 -&gt; true/false):<br> !!number;</li> <li>boolean-&gt;number (true/false -&gt;1/0)<br> +bool;</li> <li>number-&gt;string (1 -&gt; "1")<br> ""+number;</li> <li>numeric in string to number ("1" -&gt; 1)<br> +str;<br> (Will return NaN if str doesn't have a number - see also parseInt, parseFloat..)</li> </ul>
comments powered by Disqus