Skip to content

Instantly share code, notes, and snippets.

@Reshetnyak
Created June 24, 2022 13:14
Show Gist options
  • Save Reshetnyak/d3894c8f72e0d55bed96795d9b0461b8 to your computer and use it in GitHub Desktop.
Save Reshetnyak/d3894c8f72e0d55bed96795d9b0461b8 to your computer and use it in GitHub Desktop.
TS types task. Number types.
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