Hello 

This is the day 15 of #30 days of javascrip coding, at this day I studied Nested If Condition and i learned that
1- Very simply, it means that you put a condition inside another condition. For example, if I have 3 conditions with 3 different scenarios, which are as follows:
2-The first scenario is that you ask whether there is a Discount in general or not
3- The second scenario asks: Is this keyboard Egyptian?! If yes, we will create a special case here. We will assign him a separate case and give him a discount, for example, a 10-pound discount. In this special case, I will also create an exceptional case, if he is really Egyptian. I will also ask if he is a student?!
If he is a student, then the discount will be larger and it will be 30 pounds, which is the nested condition, but if he is Egyptian and not a student here, I will make the regular discount of 10 pounds.
4-The third scenario is that there is no discount at all and the person is not Egyptian
Therefore, the nested condition will not be met because the original condition was not met. The final result will be that if one of the two conditions is not met, the product will appear at its original price.
That's what I learned today 



Comments

Popular posts from this blog