You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: 'Represents the largest numeric value that can be represented in JavaScript.'
4
+
Subjects:
5
+
- 'Computer Science'
6
+
- 'Web Development'
7
+
Tags:
8
+
- 'JavaScript'
9
+
- 'Methods'
10
+
- 'Numbers'
11
+
CatalogContent:
12
+
- 'introduction-to-javascript'
13
+
- 'paths/front-end-engineer-career-path'
14
+
---
15
+
16
+
JavaScript's **`.MAX_VALUE`** represents the largest positive numeric value that can be represented using the `Number` type before it overflows to `Infinity`.
17
+
18
+
## Syntax
19
+
20
+
```pseudo
21
+
Number.MAX_VALUE;
22
+
```
23
+
24
+
**Parameters:**
25
+
26
+
None: `.MAX_VALUE` is a static property of the Number object.
27
+
28
+
**Return value:**
29
+
30
+
A number representing the largest positive finite value JavaScript can represent using the `Number` type (approximately 1.7976931348623157e+308).
31
+
32
+
## Example
33
+
34
+
This example shows what happens when a number exceeds `.MAX_VALUE`:
35
+
36
+
```js
37
+
constlarge=Number.MAX_VALUE*2;
38
+
console.log(large);
39
+
```
40
+
41
+
The output generated by this code is:
42
+
43
+
```shell
44
+
Infinity
45
+
```
46
+
47
+
Multiplying beyond `.MAX_VALUE` causes the result to overflow to `Infinity`, since JavaScript can't represent values larger than this limit.
48
+
49
+
## Codebyte Example
50
+
51
+
This codebyte example checks whether a large number is still within JavaScript's numeric limit:
0 commit comments