A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/de/docs/Web/JavaScript/Reference/Errors/Invalid_BigInt_syntax below:

SyntaxError: Ungültige BigInt-Syntax - JavaScript

SyntaxError: Ungültige BigInt-Syntax

Der JavaScript-Ausnahmefehler "ungültige BigInt-Syntax" tritt auf, wenn ein String-Wert in ein BigInt umgewandelt werden soll, aber nicht als Ganzzahl geparst werden konnte.

Meldung
SyntaxError: Cannot convert x to a BigInt (V8-based)
SyntaxError: invalid BigInt syntax (Firefox)
SyntaxError: Failed to parse String to BigInt (Safari)
Fehlerart

SyntaxError.

Was ist schiefgelaufen?

Beim Verwenden der BigInt()-Funktion zur Umwandlung eines Strings in ein BigInt wird der String auf die gleiche Weise geparst wie der Quellcode, und der resultierende Wert muss eine Ganzzahl sein.

Beispiele Ungültige Fälle
const a = BigInt("1.5");
const b = BigInt("1n");
const c = BigInt.asIntN(4, "8n");
// SyntaxError: invalid BigInt syntax
Gültige Fälle
const a = BigInt("1");
const b = BigInt("  1   ");
const c = BigInt.asIntN(4, "8");
Siehe auch MDN-Feedback-Box War diese Übersetzung hilfreich?

Diese Seite wurde automatisch aus dem Englischen übersetzt.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4