Check out example codes for "mathf.pingpong unity rotatiion". It will help you in understanding the concepts better.

Code Example 1

transform.rotation = Quaternion.Euler(0f, Mathf.PingPong(Time.time * rotateSpeed, 90f), 0f);

Learn ReactJs, React Native from akashmittal.com