scrimba
Note at 1:10
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 1:10
AboutCommentsNotes
Note at 1:10
Expand for more info
main.js
run
preview
console
function extractEachKth(nums, index) {
// write code here.
return nums.filter((x) => x % index !== 0);
}



/**
* 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