Create websites with TailwindCSS
Design blocks for your website
Start building the next great SAAS
Alpine & Tailwind UI Library
Plug'n Play Authentication for Laravel
Create website designs with AI
Blog platform for developers
Build a simple static website
21-day program to build a SAAS
const arithmeticProgression = (n, lim) =>
Array.from({ length: Math.ceil(lim / n) }, (_, i) => (i + 1) * n );
arithmeticProgression(5, 25); // [5, 10, 15, 20, 25]
Here's the snippet for Arithmetic Progression in JavaScript.
Here is what the above code is doing:
1. Create an object literal with a length property equal to the ceiling of the limit divided by the step.
2. Use Array.from to create an array with the number of entries equal to the length property.
3. Use a for loop to iterate over the array and multiply