 Hi, in this video we're going to talk about that how to use switch statement in TypeScript. With switch statement we can evaluate an expression and then match that expression's value to a case clause and finally execute statement associated with that case. Let's make a simple example with using switch statement. For example, let's say that we want to find discount of a product. So we need to make few variables. Let's make a variable product. This variable is going to be a string and let's make a variable discount. This variable is going to be a number and let's say that we want to get our product from prompt. So we're going to say product equals to and from prompt we're gonna get our product name. Let's say to our user, let's show to him text enter product name, then our user is going to enter text of the name of our product and we will store that information inside variable product and then we want to use switch statement and inside our switch statement we want to evaluate our expression. In our case expression is going to be very simple, we just want to see which product is entered from the user and we're going to return to our user an alert box which is gonna give to him information about discount. For example, if our user enter as a product name book, then we're going to say that discount for example is going to be, let's say 50% discount and we want to break from our case, further later we're going to explain what this break statement means, then on the other case our user could enter product name for example t-shirt and in that case we want to give an alert that now discount for t-shirts is 35% and we will put another break after alert and of course if user enters some other product that is not a book or a t-shirt, we want to give to him information that by default discount is going to be for example 10% okay, let's make it, let's zoom it out a little bit to be more visible. So here we have two variables, product which is string and discount which is number, we're going to get information about our product from the input and then inside our switch statement we want to test the value of our variable. We want to match the value of this product with these cases and if one of them is matched, then we're going to execute code inside that case block, for example if our user enters a book as a product then this code is going to be executed and suppose that we do not have this break statement that will means that after executing this code our program is going to continue to execute code of other case blocks which we don't want to do in this case, we want to just alert information about our discount and then to go out from this switch and if you want to go to the other cases then you don't need to use this break statement in that case after this alert all other code from these other cases and is going to be executed. So you can often see that almost in every case block you can see another one break at its end then for example if user enters as a product name t-shirt then we're going to execute this code and if user enters a name of the product which is not a book or t-shirt that means that it can be anything our default discount for this product is going to be 10% so default section is going to catch all other values which we can't evaluate with these cases that's all in this lesson thanks for watching see you in the next lesson please don't forget to subscribe to my channel