Tag algorithmic snippets

This commit is contained in:
Chalarangelo
2020-12-28 13:49:24 +02:00
parent 487884e094
commit f1e7ea5116
15 changed files with 16 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
---
title: arithmeticProgression
tags: math,beginner
tags: math,algorithm,beginner
---
Creates an array of numbers in the arithmetic progression, starting with the given positive integer and up to the specified limit.
@@ -8,7 +8,7 @@ Creates an array of numbers in the arithmetic progression, starting with the giv
- Use `Array.from()` to create an array of the desired length, `lim/n`, and a map function to fill it with the desired values in the given range.
```js
const arithmeticProgression = (n, lim) =>
const arithmeticProgression = (n, lim) =>
Array.from({ length: Math.ceil(lim / n) }, (_, i) => (i + 1) * n );
```