Check out example codes for "ionic is web check". It will help you in understanding the concepts better.

Code Example 1

this.isApp = (!document.URL.startsWith(‘http’) || document.URL.startsWith(‘http://localhost:8080’));

Learn ReactJs, React Native from akashmittal.com