Back to Upskill PortalTypeScript Basics Lab
level1.ts
let username: string = "vivek";
let age: number = 24;
let employed: boolean = true;

console.log({ username, age, employed });
TS Compiler Terminal HUDSTRICT_MODE: ON
Click the run button to execute level1.ts through the simulated type verification loop...

Type Verification

•TypeScript allows annotating variables with explicit types using colon syntax: variableName: type
•If you attempt to assign a value of a different type (e.g. username = 42), the TS compiler throws a type-checking error at compile time.
•Primitive types correspond directly to JavaScript primitives: string, number, boolean, null, undefined, and symbol.
Exercise Practice

Try writing variations of this TS type contract on your local editor to test the limits of strict mode compilation.