I thought it doing like this:
const months2 = ['Jan', 'March', 'April', 'June'];
console.log(months2.splice(3, 1));
output: [ 'June' ]
You actually have it exactly right. Array.splice removes elements from the existing array and returns the elements that were removed.
const months2 = ['Jan', 'March', 'April', 'June'];
console.log(months2.splice(3, 1)); // Output: ['June']
console.log(months2); // Output: ['Jan', 'March', 'April']