Skip to content
Jobless Busters
JavaScriptQuestion 35 of 36Multiple choice

slice or splice — which changes the array?

What will arr contain after both lines run?

JavaScript
const arr = [1, 2, 3, 4];
arr.slice(1, 3);
arr.splice(1, 2);

Choose one answer.

Source: Quiz question based on a card · Full Stack / JS

The answer and explanation come from the source card linked below.