Alright so now we are going to write a story to finish this 1
project. So the first thing we have to do is to create two 2
bank accounts with $40, 000 and $100, 000. We are all set here. 3
Then set 1% of mensual interest for each of these 4
accounts and a ceiling of 50thousand so we are all good 5
here. Then add the bank account 2 to to bank account one's 6
favorite so let's do that with add account to favorites 7
account two okay then transfer $20, 000 from one to its first 8
favorite bank account so let's do a transfer money transfer 9
money so we have to send an amount so $20, 000 to it's one... 10
to it's first favorite so account one.get favorite accounts 11
and let's take the first one okay we're good with that then 12
withdraw 25K from bank account one so sure account one dot 13
withdraw 25, 000 and we should catch the error if there is one 14
so let's do that try and catch. Error so you remember we have 15
to type that unknown and we are going to display 16
error.message but as you can see error is unknown 17
so we have to cast that and force the typing for the error 18
like this. Okay? Now display the amount of mensual 19
interest on bank account one. Sure thing. So console log 20
account one. get mensual interests. All right. Finally 21
display the balance of account one. Sure thing. Balance Account 22
one is going to be account one dot get balance and here I'm 23
just going to display account one mensual interests 24
and finally remove bank account two from bank account one 25
favorites okay sure thing so just going to do an account one 26
dot remove favorite by ID and this should be the ID2 okay 27
let's try to compile all of this 28
npm start... And everything seems fine we have an error 29
here that has been catched account one yes value is good 30
then the balance of account one is still 20, 000 make sense 31
okay all right so now you got the typescript basics okay you 32
know how to type things how to create classes how to create 33
interfaces how to create your own types how to type with 34
number et cetera which is very cool now we're going to go a 35
little bit deeper in the next video and discover the other 36
things that you can do with typescript okay so see you in 37
the next one.