Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
118
rated 0 times [  122] [ 4]  / answers: 1 / hits: 8166  / 4 Years ago, mon, october 12, 2020, 12:00:00

I don't get it why?


export const CompanyProfileStub: Company = {
id: 1
};

how do I fix this?


export interface Company {
id: bigint;
}

More From » javascript

 Answers
12

Basically, you can't assign a Number to a BigInt since it's a different kind of primitive.
You can create a BigInt in JS using the constructor of the BigInt like so:


const huge = BigInt(9007199254740991)

or using n at the end of the number like so:


const huge = 1n

[#2503] Thursday, October 8, 2020, 4 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
masonm

Total Points: 167
Total Questions: 87
Total Answers: 103

Location: Rwanda
Member since Wed, Jun 8, 2022
2 Years ago
;