Check out example codes for "application.quit() 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
Application.Quit();
Learn ReactJs, React Native from akashmittal.com