0
1
00:00:00,000 --> 00:00:03,581
Alright so now we are going to
write a story to finish this
1

2
00:00:03,581 --> 00:00:07,741
project. So the first thing we
have to do is to create two
2

3
00:00:07,741 --> 00:00:13,741
bank accounts with $40, 000 and
$100, 000. We are all set here.
3

4
00:00:13,741 --> 00:00:17,101
Then set 1% of mensual
interest for each of these
4

5
00:00:17,101 --> 00:00:21,821
accounts and a ceiling of
50thousand so we are all good
5

6
00:00:21,821 --> 00:00:28,601
here. Then add the bank account 2
to to bank account one's
6

7
00:00:28,601 --> 00:00:33,841
favorite so let's do that with
add account to favorites
7

8
00:00:33,841 --> 00:00:42,841
account two okay then transfer
$20, 000 from one to its first
8

9
00:00:42,841 --> 00:00:48,201
favorite bank account so let's
do a transfer money transfer
9

10
00:00:48,201 --> 00:00:54,681
money so we have to send an
amount so $20, 000 to it's one...
10

11
00:00:54,681 --> 00:01:01,561
to it's first favorite so account
one.get favorite accounts
11

12
00:01:01,561 --> 00:01:06,921
and let's take the first one
okay we're good with that then
12

13
00:01:06,921 --> 00:01:14,721
withdraw 25K from bank account
one so sure account one dot
13

14
00:01:14,721 --> 00:01:21,001
withdraw 25, 000 and we should
catch the error if there is one
14

15
00:01:21,001 --> 00:01:28,321
so let's do that try and catch.
Error so you remember we have
15

16
00:01:28,321 --> 00:01:36,761
to type that unknown and we are
going to display
16

17
00:01:39,721 --> 00:01:45,581
error.message but
as you can see error is unknown
17

18
00:01:45,581 --> 00:01:49,221
so we have to cast that and
force the typing for the error
18

19
00:01:49,221 --> 00:01:56,221
like this. Okay? Now display
the amount of mensual
19

20
00:01:56,221 --> 00:02:02,261
interest on bank account one.
Sure thing. So console log
20

21
00:02:02,261 --> 00:02:10,701
account one. get mensual
interests. All right. Finally
21

22
00:02:10,701 --> 00:02:18,701
display the balance of account
one. Sure thing. Balance Account
22

23
00:02:18,701 --> 00:02:23,661
one is going to be account one
dot get balance and here I'm
23

24
00:02:23,661 --> 00:02:31,821
just going to display account
one mensual interests
24

25
00:02:32,721 --> 00:02:37,861
and finally remove bank account
two from bank account one
25

26
00:02:37,861 --> 00:02:44,741
favorites okay sure thing so
just going to do an account one
26

27
00:02:44,741 --> 00:02:51,541
dot remove favorite by ID and
this should be the ID2 okay
27

28
00:02:51,541 --> 00:02:55,381
let's try to compile all of
this
28

29
00:02:58,721 --> 00:03:06,501
npm start... And everything
seems fine we have an error
29

30
00:03:06,501 --> 00:03:10,781
here that has been catched
account one yes value is good
30

31
00:03:10,781 --> 00:03:15,061
then the balance of account one
is still 20, 000 make sense
31

32
00:03:15,061 --> 00:03:19,461
okay all right so now you got
the typescript basics okay you
32

33
00:03:19,461 --> 00:03:22,021
know how to type things how to
create classes how to create
33

34
00:03:22,021 --> 00:03:25,541
interfaces how to create your
own types how to type with
34

35
00:03:25,541 --> 00:03:30,501
number et cetera which is very
cool now we're going to go a
35

36
00:03:30,501 --> 00:03:32,901
little bit deeper in the next
video and discover the other
36

37
00:03:32,901 --> 00:03:35,381
things that you can do with
typescript okay so see you in
37

38
00:03:35,381 --> 00:03:38,121
the next one.
