Check out example codes for "Check object is in layermask unity". It will help you in understanding the concepts better.

Code Example 1

public bool IsInLayerMask(GameObject obj, LayerMask layerMask)
{
	return ((layerMask.value & (1 << obj.layer)) > 0);
}

Learn ReactJs, React Native from akashmittal.com