Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele BigInt 1/3 | Data Types and Variables
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Introduction to JavaScript (staging)

bookBigInt 1/3

BigInt:

In JavaScript, we have a BigInt data type in which we can assign the integer of arbitrary length to an integer.

We can create BigInt by placing the n at the end of the integer or we can simply call the BigInt() function that creates an integer of arbitrary length from a string.

123456789
let bigint = 123456789n; console.log(bigint); let bigintFromString = BigInt("123456789"); let bigintFromInteger = BigInt(123456789); console.log(bigint); console.log(bigintFromString); console.log(bigintFromInteger);
copy
Tehtävä

Swipe to start coding

Create a BigInt() from the string “982945944” by using the BigInt() function and store it in the variable netWorth and display the value on the console.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 24
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

Suggested prompts:

Can you explain the difference between using the `n` suffix and the `BigInt()` function?

What are some use cases where BigInt is necessary in JavaScript?

Are there any limitations or caveats when working with BigInt in JavaScript?

close

bookBigInt 1/3

Pyyhkäise näyttääksesi valikon

BigInt:

In JavaScript, we have a BigInt data type in which we can assign the integer of arbitrary length to an integer.

We can create BigInt by placing the n at the end of the integer or we can simply call the BigInt() function that creates an integer of arbitrary length from a string.

123456789
let bigint = 123456789n; console.log(bigint); let bigintFromString = BigInt("123456789"); let bigintFromInteger = BigInt(123456789); console.log(bigint); console.log(bigintFromString); console.log(bigintFromInteger);
copy
Tehtävä

Swipe to start coding

Create a BigInt() from the string “982945944” by using the BigInt() function and store it in the variable netWorth and display the value on the console.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 24
single

single

some-alt