The maximum number of decimals is 17.
Adding Numbers and Strings
JavaScript interpreter works from left to right. ex) number + number +string case, both numbers added andthen add string
NaN - Not a Number
NaN + number = NaN, NaN + string ="NaNstring"
Infinity
calculate a number outside the largest possible number.
Hexadecimal
number.toString( Number system ) :
BigInt
JavaScript can only safely represent integers:
Up to 9007199254740991 +(253-1) Down to -9007199254740991 -(253-1).
How to Create a BigInt
BigInt(num); or let x = 12345.......n;
Arithmetic between a BigInt and a Number is not allowed
Minimum and Maximum Safe Integers
Number.MAX_SAFE_INTEGER : Integer max value
Number.MIN_SAFE_INTEGER : Integer min value
Number.isInteger(number) : returns true if the argument is an integer.
Number.isSafeInteger(number) : r eturns true if the argument is a safe integer.
Number.MAX_VALUE : the largest possible number in JavaScript.
Number.MIN_VALUE : the lowest possible number in JavaScript.
Number.POSITIVE_INFINITY
Number.NEGATIVE_INFINITY
Number Methods
toString() | Returns a number as a string |
toExponential() | Returns a number written in exponential notation |
toFixed() | Returns a number written with a number of decimals |
toPrecision() | Returns a number written with a specified length |
valueOf() | Returns a number as a number |
Converting Variables to Numbers
Number() | Returns a number converted from its argument. |
parseFloat() | Parses its argument and returns a floating point number |
parseInt() | Parses its argument and returns a whole number |
function isNaN() : find out if a value is a not a number
'JAVASCRIPT' 카테고리의 다른 글
20241122_1 Date Objects (0) | 2024.11.22 |
---|---|
20241121_2 Arrays (0) | 2024.11.21 |
20241120_ String (Methods,Templates) (0) | 2024.11.20 |
20241120_2 기초2 (2) | 2024.11.20 |
20241120_1 기본 (6) | 2024.11.20 |