const pets = ['Dog', 'Cat', 'Hamster', 'Squirrel'];
console.log('Before');
console.log(pets);
console.log(`\n----------------------------------------------\n`);
const slice1 = pets.slice(2, 4);
console.log(`returns element: ${slice1}`);
console.log('\nAfter');
console.log(pets);
console.log(`\n----------------------------------------------\n`);
const slice2 = pets.slice(2);
console.log(`returns element: ${slice2}`);
console.log('\nAfter');
console.log(pets);
This Pen doesn't use any external CSS resources.