Check out example codes for "whats the binary nmber system". It will help you in understanding the concepts better.

Code Example 1

The binary number system is a number expressed in the base-2 numeral system

Learn ReactJs, React Native from akashmittal.com