JavaScript Positive factorial
🔢 Factorial Calculation: Functional vs. Procedural
This project demonstrates two distinct approaches to calculating the factorial of a number (
📂 File Includedfactorial.js: Contains two functions that calculate the factorial of a given integer (in this case, 7).
🧠 Core Concepts CoveredModern
Functional Approach (factorial):Array.from(): Used to generate a sequence of numbers from 0 to
Traditional Procedural Approach (fac2):for Loop: Uses a standard incrementing loop to multiply a running total (fac2) by the current index.Initialization: Demonstrates starting the product at 1 to ensure correct multiplication.