1
00:00:00,300 --> 00:00:05,910
Hello, friends, who won our last lesson, we talked about data types in typescript, so now I want

2
00:00:05,910 --> 00:00:11,480
to carry on with that concept in this particular lesson.

3
00:00:11,820 --> 00:00:15,980
So we talked about the enum keyword last.

4
00:00:16,860 --> 00:00:20,420
So we'll start with the void type in this lesson.

5
00:00:21,610 --> 00:00:28,010
As you already know, we use the void type in functions that do not return any value, so it simply

6
00:00:28,010 --> 00:00:29,060
define a function.

7
00:00:36,200 --> 00:00:38,360
And a console print, hello.

8
00:00:46,280 --> 00:00:49,120
And if you wish, you can return a different value.

9
00:00:52,520 --> 00:00:59,390
However, if we come in here and define the function as void, then returning will give us an error

10
00:01:00,080 --> 00:01:05,220
because we specify that we will not return any value by making the function void.

11
00:01:06,350 --> 00:01:13,940
So if we don't want to return any value and we want to do an operation there, we can use the void type

12
00:01:14,240 --> 00:01:16,280
to print something like here.

13
00:01:18,150 --> 00:01:24,780
All right, now let's get into, well, briefly, the undefined type, actually, what this data type

14
00:01:24,780 --> 00:01:25,320
means.

15
00:01:26,640 --> 00:01:29,430
So we've defined a number variable, but.

16
00:01:33,180 --> 00:01:39,090
If we've not assigned any value to this variable, this variable will be undefined.

17
00:01:40,120 --> 00:01:45,690
But if we come in here and assign a value here, then undefined will disappear.

18
00:01:49,070 --> 00:01:55,370
You know, the data types similar to undefined is the null type, and we usually encounter these and

19
00:01:55,370 --> 00:01:56,300
database errors.

20
00:01:57,740 --> 00:02:00,650
So I should say that we've defined a class, but.

21
00:02:03,700 --> 00:02:10,030
We haven't shown any references like this, and when we want to access this class, the result will,

22
00:02:10,030 --> 00:02:10,900
of course be no.

23
00:02:11,900 --> 00:02:14,300
Because we do not provide any reference.

24
00:02:17,150 --> 00:02:22,730
So that's that's that for data times, but before we finish the lesson here, I want to talk a little

25
00:02:22,730 --> 00:02:25,070
bit about data assertions.

26
00:02:27,870 --> 00:02:33,690
To evaluate the situation, I'll first create a variable and define a string expression.

27
00:02:37,800 --> 00:02:41,670
So look here, we can see that our variable now is a string.

28
00:02:42,940 --> 00:02:45,730
Now, if we write our variable and put a dot.

29
00:02:46,760 --> 00:02:49,940
We can see the string methods that we can use.

30
00:02:52,120 --> 00:02:59,560
Thus, we can do different operations on this variable, for example, when we well, we can capitalize

31
00:02:59,560 --> 00:03:01,240
all the letters here or.

32
00:03:02,660 --> 00:03:05,330
We can use the length of this string expression.

33
00:03:07,440 --> 00:03:12,540
And here I'm assigning the character length of the string expression to a different variable like this.

34
00:03:17,670 --> 00:03:21,260
So there's no problem with the transactions that we've done so far.

35
00:03:22,830 --> 00:03:27,150
So what will happen if I change the variable that I first define?

36
00:03:27,840 --> 00:03:30,840
Well, this variable is no longer a string.

37
00:03:31,560 --> 00:03:33,420
It's an any variable.

38
00:03:35,130 --> 00:03:37,710
When we put a dot here again and look at it.

39
00:03:39,310 --> 00:03:47,440
We can't use a previous method because those methods are valid for string variables, so in order to

40
00:03:47,440 --> 00:03:55,420
fix this, I write the type I want to convert between the lesson and read it in signs.

41
00:03:57,340 --> 00:03:59,290
And I put this expression in parenthesis.

42
00:04:03,650 --> 00:04:08,090
And as you can now see, when I put a dot, I can see the method.

43
00:04:09,470 --> 00:04:15,110
So in this way, we have converted a variable that is any to a string variable.

44
00:04:17,290 --> 00:04:23,770
So here, you definitely need to pay attention to the variable that we want to transform and the variable

45
00:04:23,770 --> 00:04:25,450
here must be the same.

46
00:04:27,150 --> 00:04:33,750
Oh, get an error if I come in here and right, no, right, because this is a stirring expression.

47
00:04:36,370 --> 00:04:40,080
So we can write this expression differently as follows.

48
00:04:41,040 --> 00:04:47,040
So define another variable and I'll write the name of the first variable.

49
00:04:49,740 --> 00:04:53,040
Then right as string inferences.

50
00:04:56,590 --> 00:05:01,690
And as you can see, we can now recognize that they are string method's.

51
00:05:03,740 --> 00:05:08,570
So we can make the type conversion into different forms of writing.

52
00:05:10,840 --> 00:05:18,220
And that said, I think we're done now, so in our next lesson, we're going to start functions.

53
00:05:18,250 --> 00:05:18,630
All right.

54
00:05:18,820 --> 00:05:19,380
See you then.
