Advertisements
Explain about defining numbers in Java Script?
Java Script represents numbers in the form of IEEE-754 doubles. This form of representation provides accuracy upto 14-15 significant digits. They represent fractions but not the decimal numbers to an extent. To perform explicit numeric conversion you can use Number constructor.
<script type="text/javascript"> function add(){ var a = "55"; var b = "45"; alert( Number(a) + Number(b) ); } </script>