Check out example codes for "how many sets of 3 in 4". It will help you in understanding the concepts better.

Code Example 1

nCr = n!/(r!(n-r)!)
4C3 = 4!/(3!(4-3)!)
    = 24/(6*1)
    = 4

Learn ReactJs, React Native from akashmittal.com