Check out example codes for "obtain last digit of large fibonnaci number". It will help you in understanding the concepts better.

Code Example 1

0, 1, 1, 2, 3, 5, 8, 3, 1, 4, 5, 9, 4, 3, 7, 0, 7, ...

Code Example 2

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, ...

Learn ReactJs, React Native from akashmittal.com