Before diving deep, Let’s understand why we need functions in the first place. Every code follows the DRY principle(Don’t Repeat Yourself). The bedrock of the DRY principle is Functions. Let’s add two numbers, 10 and 20, const sum1 = 10 + 20; Let’s add 50 and 60, const sum2 =…