Check out example codes for "typescript switch". It will help you in understanding the concepts better.

Code Example 1

switch(expression) { 
   case constant-expression1: { 
      //statements; 
      break; 
   } 
   case constant_expression2: { 
      //statements; 
      break; 
   } 
   default: { 
      //statements; 
      break; 
   } 
}

Learn ReactJs, React Native from akashmittal.com