1
00:00:01,090 --> 00:00:03,670
Hello, everybody.

2
00:00:04,000 --> 00:00:10,600
All right, so in this lesson, we're going to start using TypeScript and quickly move into typescript

3
00:00:10,930 --> 00:00:11,650
basics.

4
00:00:13,240 --> 00:00:14,140
It's now, my friends.

5
00:00:14,140 --> 00:00:21,850
First of all, we'll need to install typescript onto the computer via NPM and for this all over the

6
00:00:21,850 --> 00:00:25,000
command line and type NPM install G typescript.

7
00:00:33,610 --> 00:00:34,630
Run this command.

8
00:00:39,480 --> 00:00:41,460
And after the installation is completed.

9
00:00:43,540 --> 00:00:49,930
You can check which version was installed by running the TSC Dash Dash version command.

10
00:00:54,210 --> 00:00:59,670
So in our case, this version has been in stone and we've completed the installation process.

11
00:01:03,240 --> 00:01:09,090
Now, before we get into the code section, I want to create a folder on the desktop for typescript

12
00:01:09,090 --> 00:01:10,020
studies.

13
00:01:11,820 --> 00:01:14,460
And I'll open a visual studio code.

14
00:01:17,180 --> 00:01:26,060
And here, I'll get to the final tab and click, and in the section that appears, I add the typescript

15
00:01:26,060 --> 00:01:29,390
file on the desktop by saying and folder.

16
00:01:33,660 --> 00:01:35,370
Now, add a new file with.

17
00:01:38,810 --> 00:01:42,860
This tax extension, just by saying new file in this folder.

18
00:01:46,060 --> 00:01:52,520
And in fact, whatever, Ed, you use, the operations that we do will generally be the same.

19
00:01:54,010 --> 00:01:59,830
Creating a new folder, opening new file for it, or you can continue without creating any folders,

20
00:01:59,830 --> 00:02:02,890
but I always think it's important for order.

21
00:02:05,850 --> 00:02:13,100
So therefore, I will continue by creating new folders for each section in general and.

22
00:02:13,680 --> 00:02:17,610
OK, so now that that's done, let's start writing code and our file.

23
00:02:19,300 --> 00:02:24,580
Now, define a simple method and console will print the parameter that we've given.

24
00:02:31,380 --> 00:02:35,760
First, print the parameter we give, then the word world.

25
00:02:41,810 --> 00:02:45,170
And now we can define our variable with let code.

26
00:02:52,930 --> 00:02:54,980
Then call the method with this variable.

27
00:02:56,230 --> 00:02:57,470
So now here I want to show you.

28
00:02:58,210 --> 00:03:06,460
So here, look, if if we want to in JavaScript, we can define this variable as a string value or a

29
00:03:06,460 --> 00:03:11,920
number or an array, and we will have no absolutely no problems.

30
00:03:11,920 --> 00:03:19,540
But in typescript, if we define the value that our method will receive as a string and then.

31
00:03:20,620 --> 00:03:26,440
Give a number, we're going to get an error here right before we run it, we can see a problem with

32
00:03:26,440 --> 00:03:26,890
our code.

33
00:03:28,150 --> 00:03:33,520
So that means that you can get in a little bit more with TypeScript.

34
00:03:34,160 --> 00:03:35,980
Just one of the benefits of TypeScript.

35
00:03:46,800 --> 00:03:48,670
So we've prepared our file.

36
00:03:49,140 --> 00:03:50,910
So now this file needs to be run.

37
00:03:51,120 --> 00:03:52,410
So what do we say?

38
00:03:52,710 --> 00:03:59,760
It's extension files need to be compiled first and we need to convert them to JavaScript files in order

39
00:03:59,760 --> 00:04:00,810
to work in the browser.

40
00:04:03,140 --> 00:04:09,230
So I will open the terminal and I'm running typescript compiler by typing, see?

41
00:04:13,150 --> 00:04:14,740
And I'll write the file name.

42
00:04:19,340 --> 00:04:27,080
As you can see, when we run our code, a new file is created with the same file name, but with a JSA

43
00:04:27,080 --> 00:04:27,800
extension.

44
00:04:29,770 --> 00:04:35,890
All right, so when we look into it, what's the difference between these two files, we see the delete

45
00:04:35,890 --> 00:04:43,420
code that we made just for the variable definition has changed and turned into var code.

46
00:04:44,480 --> 00:04:45,200
Important.

47
00:04:46,660 --> 00:04:48,730
An hour file can be run easily.

48
00:04:54,290 --> 00:04:59,750
So what do you think we can now see the value that we want in the console?

49
00:05:02,590 --> 00:05:03,940
Sure enough, my friends.

50
00:05:05,770 --> 00:05:12,550
We have met TypeScript in a very simple way, and in the next lesson, we're going to talk about data

51
00:05:12,550 --> 00:05:12,920
types.

52
00:05:13,300 --> 00:05:13,660
All right.

53
00:05:13,930 --> 00:05:15,280
So see you then.
