Check out example codes for "c# how to terminate console application". It will help you in understanding the concepts better.
Code Example 1
System.Envrionment.Exit(0);
//or
Envrionment.Exit(0);
Learn ReactJs, React Native from akashmittal.com