Check out example codes for "set the nth bit". It will help you in understanding the concepts better.

Code Example 1

number |=  (1 << n);

Learn ReactJs, React Native from akashmittal.com