Check out example codes for "application.stop unity". It will help you in understanding the concepts better.

Code Example 1

using UnityEngine;
using System.Collections;// Quits the player when the user hits escapepublic class ExampleClass : MonoBehaviour
{
    void Update()
    {
        if (Input.GetKey("escape"))
        {
            Application.Quit();
        }
    }
}

Code Example 2

//Quit/Stop Game
Application.Quit();

Learn ReactJs, React Native from akashmittal.com