PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Arithmetic Progression

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.

BETA Snippet explanation automatically generated by OpenAI:

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

Snippet By Dhairya Shah

ยท

Created February 27th, 2022

ยท

Report Snippet