Check out example codes for "How To Get The Global Position of a GameObject in a Variable". It will help you in understanding the concepts better.

Code Example 1

// for unity users only!

// use transform instead of GetComponent<Transform>

void Start()
  Vector3 LocalPosition = gameObject.GetComponent<Transform>().position;
  Vector3 GloabalPosition = gameObject.transform.position;

Learn ReactJs, React Native from