Created
June 24, 2022 13:14
-
-
Save Reshetnyak/d3894c8f72e0d55bed96795d9b0461b8 to your computer and use it in GitHub Desktop.
TS types task. Number types.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const age = 30; | |
let yearsOfExperience = 0.5; | |
const notANumber = NaN; | |
// we know exactly that we have only 4 possible values: 1, 2, 3, 4. | |
let accessRigth = 2; | |
accessRigth = 5; // should be a TS error; | |
yearsOfExperience = 'hello'; // should be a TS error; | |
// 'target' property of the tsconfig.json file has to be `ES2020`; | |
const bigInt = BigInt(220 ** 20); | |
let bigIntLiteral = 999999n; | |
bigIntLiteral = 10; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment