Updated linter to work with restructure
This commit is contained in:
@ -6,12 +6,12 @@ Generate an array from `2` to the given number. Use `Array.filter()` to filter o
|
||||
|
||||
```js
|
||||
const primes = num => {
|
||||
let arr = Array.from({length:num-1}).map((x,i)=> i+2),
|
||||
sqroot = Math.floor(Math.sqrt(num)),
|
||||
numsTillSqroot = Array.from({length:sqroot-1}).map((x,i)=> i+2);
|
||||
numsTillSqroot.forEach(x => arr = arr.filter(y => ((y%x)!==0)||(y==x)));
|
||||
let arr = Array.from({length: num - 1}).map((x, i) => i + 2),
|
||||
sqroot = Math.floor(Math.sqrt(num)),
|
||||
numsTillSqroot = Array.from({length: sqroot - 1}).map((x, i) => i + 2);
|
||||
numsTillSqroot.forEach(x => arr = arr.filter(y => ((y % x) !== 0) || (y == x)));
|
||||
return arr;
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user