Check out a free preview of the full Deep JavaScript Foundations, v3 course

The "BigInt" Lesson is part of the full, Deep JavaScript Foundations, v3 course featured in this preview video. Here's what you'd learn in this lesson:

Kyle explains how BigInt differs from other numbers in JavaScript.


Transcript from the "BigInt" Lesson

>> Kyle Simpson: Remember BigInts, they're a primitive type. So when you assign a BigInt using a literal, for example like line 2, 42n is not just the number 42, but it's 42 within this space where it can grow essentially infinitely large, up to the memory space on the system, of course.

It can essentially have an integer that grows infinitely large. That's a separate partition, it's not an IEEE number like all the other numbers in JavaScript. And you have to be very careful, because BigInts and regular numbers, they don't really mix and match that well. They're totally separated things, if you will.

And so it's gonna be really useful for us if we have a thing that looks like a number to determine is that a number, or is it a BigInt? Which is why typeof, at least at the moment, is slated to return us the string, BigInt.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now