scrimba
Note at 0:06
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Note at 0:06
AboutCommentsNotes
Note at 0:06
Expand for more info
main.js
run
preview
console
function extractEachKth(nums, index) {
let extractArray = nums.filter(num => num % index !== 0);
return extractArray;
}



/**
* Test Suite
*/
describe('extractEachKth()', () => {
it('returns largest positive integer possible for digit count', () => {
// arrange
const nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const index = 3;

// act
const result = extractEachKth(nums, index);

// log
console.log("result: ", result);

// assert
expect(result).toEqual([1, 2, 4, 5, 7, 8, 10]);
});
});
Console
"result: "
,
[
1
,
2
,
4
,
5
,
7
,
8
,
10
]
,
/index.html
LIVE