Skip to content

Create new .md entry for JavaScript .MAX_VALUE #7345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
Title: '.MAX_VALUE'
Description: 'Represents the largest numeric value that can be represented in JavaScript.'
Subjects:
- 'Computer Science'
- 'Web Development'
Tags:
- 'JavaScript'
- 'Methods'
- 'Numbers'
CatalogContent:
- 'introduction-to-javascript'
- 'paths/front-end-engineer-career-path'
---

JavaScript's **`Number.MAX_VALUE`** represents the largest positive numeric value that can be represented using the `Number` type before it overflows to `Infinity`.

## Syntax

```pseudo
Number.MAX_VALUE;
```

**Parameters:**

None: `.MAX_VALUE` is a static property of the Number object.

**Return value:**

A number representing the largest positive finite value JavaScript can represent using the `Number` type (approximately 1.7976931348623157e+308).

## Example

This example shows what happens when a number exceeds `Number.MAX_VALUE`:

```js
const large = Number.MAX_VALUE * 2;
console.log(large);
```

The output generated by this code is:

```shell
Infinity
```

Multiplying beyond `Number.MAX_VALUE` causes the result to overflow to `Infinity`, since JavaScript can't represent values larger than this limit.

## Codebyte Example

This example checks whether a large number is still within JavaScript's numeric limit:

```codebyte/javascript
const safe = 1e+307;
console.log(safe < Number.MAX_VALUE);
```