Coding task · JavaScript and TypeScript course · Module 2: Functions, Arrays and Objects
BigInt Calculations
A BigInt literal ends with the letter n. In calculations a BigInt can only be combined with other BigInts, so write the number of days in a year as 365n.
Task
Store as BigInt: const dinoEraStart = 245000000n (the start of the dinosaur era in years ago) and const dinoEraEnd = 66000000n (its end). Calculate dinoEraDuration as the difference dinoEraStart - dinoEraEnd, and dinoEraDays as dinoEraDuration multiplied by 365n. Display both results in the console.