const pets = ['Dog', 'Cat', 'Hamster', 'Squirrel'];

console.log('Before');
console.log(pets);
console.log(`\n----------------------------------------------\n`);


const sort1 = pets.sort();

console.log(`returns element: ${sort1}`);
console.log('\nAfter');
console.log(pets);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://codepen.io/nullobject/pen/cngzI.js