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

pets.forEach(function(element, index, array){
  console.log('\nIndex:' + index);
  console.log('Element:' + element);
  console.log('Array:' + array);
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

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