Passed the fourth test from exercise 04
This commit is contained in:
parent
2d6400b9bb
commit
f0c8df6081
|
@ -8,13 +8,14 @@ const removeFromArray = function(array, ...remove) {
|
||||||
}
|
}
|
||||||
array.pop();
|
array.pop();
|
||||||
for (let i = 0; i < saveArray.length; i++) {
|
for (let i = 0; i < saveArray.length; i++) {
|
||||||
array.push(saveArray[i]);
|
array.push(saveArray[saveArray.length - 1 - i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return array;
|
return array;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
removeFromArray([1, 2, 3, 4], 7, 2);
|
||||||
|
|
||||||
// Do not edit below this line
|
// Do not edit below this line
|
||||||
module.exports = removeFromArray;
|
module.exports = removeFromArray;
|
||||||
|
|
|
@ -10,7 +10,7 @@ describe('removeFromArray', () => {
|
||||||
test('ignores non present values', () => {
|
test('ignores non present values', () => {
|
||||||
expect(removeFromArray([1, 2, 3, 4], 7, "tacos")).toEqual([1, 2, 3, 4]);
|
expect(removeFromArray([1, 2, 3, 4], 7, "tacos")).toEqual([1, 2, 3, 4]);
|
||||||
});
|
});
|
||||||
test.skip('ignores non present values, but still works', () => {
|
test('ignores non present values, but still works', () => {
|
||||||
expect(removeFromArray([1, 2, 3, 4], 7, 2)).toEqual([1, 3, 4]);
|
expect(removeFromArray([1, 2, 3, 4], 7, 2)).toEqual([1, 3, 4]);
|
||||||
});
|
});
|
||||||
test.skip('can remove all values', () => {
|
test.skip('can remove all values', () => {
|
||||||
|
|
Loading…
Reference in New Issue