Course Content
Introduction to TypeScript
Introduction to TypeScript
Summary
Congratulations!
You've taken a small step for a person but a giant leap for your successful career! You've successfully completed the beginner course on TypeScript, and that's commendable. If you've tackled all the tasks and studied the theory, you're doing great! But if you skipped chapters just to get the certificate, well, that's your problem.
Let's summarize the entire beginner course, what TypeScript is, and why it's essential. We'll revisit the basic syntax, TypeScript's advantages, and much more.
Overall
TypeScript is a general purpose programming language that serves as a superset of JavaScript. TypeScript stands out with its static typing, error highlighting during the coding phase, object-oriented programming features, and many other improvements compared to JavaScript.
TypeScript is beloved and widely used. It's the go-to choice for front-end development in many prominent companies and is a key component in various popular frameworks. The simplest example is Angular.
Syntax
To display information in the console, we use the following syntax:
javascript
If we want to declare a variable without any type, we can use the following syntax:
javascript
Typed variable:
typescript
One-line comment:
javascript
Multi-line comment:
javascript
Conditional Statements
Syntax of the if
statement:
javascript
condition
must have a boolean
type!
if-else
statement:
javascript
Switch-case:
javascript
Arrays
Declaring array:
javascript
Zero-based indexing:
javascript
It means that the first element in the array will have an index 0, the second element will have an index 1, and so on.
You can get the element from the array using it's index:
javascript
You can also modify the array's elements using their indexes:
javascript
You can explore array methods in this chapter: Working with Array Elements
Loops
while-loop
syntax:
javascript
The keyword break
is used to immediately stop the execution of a loop.
do-while
loop syntax:
javascript
The do-while
loop will execute at least once.
for
loop syntax:
javascript
Functions
Functions syntax:
javascript
How to call a function?
javascript
These are the basic concepts and syntax you've covered in this course.
From this point on, you have a foundation in TypeScript, and you can write simple programs and functions. In future courses, you will learn more advanced topics, such as object-oriented programming, classes, objects, anonymous functions, and much more.
Now, I want to congratulate you once again and wish you a well-deserved rest. You've done great!
Thanks for your feedback!