Numbers may be specified in any of these notations:<syntaxhighlight lang=JavaScript>345; // an "integer", although there is only one numeric type in JavaScript34.5; // a floating-point number3.45e2; // another floating-point, equivalent to 3450377; // an octal integer equal to 2550xFF; // a hexadecimal integer equal to 255, digits represented by the ...</syntaxhighlight>The extents +∞, −∞ and NaN (Not a Number) of the number type may be obtained by two program expressions:<syntaxhighlight lang=JavaScript>Infinity; // positive infinity (negative obtained with -Infinity for instance)NaN; // The Not-A-Number value, also returned as a failure in ...</syntaxhighlight>These three special values correspond and behave as the IEEE-754 describes them.
<syntaxhighlight lang="JavaScript">345; // an "integer", although there is only one numeric type in JavaScript34.5; // a floating-point number3.45e2; // another floating-point, equivalent to 3450377; // an octal integer equal to 2550xFF; // a hexadecimal integer equal to 255, digits represented by the...</syntaxhighlight>کران‌های +∞, −∞ و NaN (Not a Number) به صورت‌های زیر طبق استاندارد IEEE-754 مشخص می‌شوند:<syntaxhighlight lang="JavaScript">Infinity; // Positive Infinity (negative obtained with -Infinity for instance)NaN; // The Not-A-Number value, also returned as a failure in...</syntaxhighlight><syntaxhighlight lang="JavaScript">var myString = "۱۲۳٫۴۵۶";var myNumber1 = Number(myString);var myNumber2 = +myString;</syntaxhighlight>رشته‌ها دنباله‌ای از کاراکترها هستند که بین دو علامت codice_4 یا codice_5 قرار داده می شوند.