TypeScript Beginner Tutorial 5 | Basic Variable Types 1

preview_player
Показать описание
Types of Variables:
Number
String
Boolean
Null
Undefined
Arrays

Number
let x: number = 10

String
let name: string = ‘TypeScript’

Boolean
let learningTypeScript: boolean = true

Static type checking, prevent from making mistakes
Accurate Intellisense

Undefined
A variable that has been declared but not yet assigned value
let u: undefined = undefined

Null
Null is assignment value. Can be assigned as representation of no value
let n: null = null

Null and undefined are sub types i.e. null and undefined can be assigned to boolean, number and string variables

#TypeScriptTutorials

Every LIKE & SUBSCRIPTION gives me great motivation to keep working for you

You can support my mission for education by sharing this knowledge and helping as many people as you can

If my work has helped you, consider helping any animal near you, in any way you can.

________ ONLINE COURSES TO LEARN ________

Never Stop Learning
Raghav
Рекомендации по теме
Комментарии
Автор

Hi, what you're doing at the end, assign null to num1 and undefined to nyName does not work. At least on my side. Perhaps some updates on Typescript ?

nicolasma