Skip to content

Instantly share code, notes, and snippets.

View isaka-lumato's full-sized avatar

Isaac William Lumato isaka-lumato

View GitHub Profile
const pets = ['Cat', 'Dog', 'Bird', 'Fish', 'Frog', 'Hamster', 'Pig', 'Horse' 'Lion', 'Dragon'];
// Print all pets
//this code is not dry
console.log(pets[0]);
console.log(pets[1]);
console.log(pets[2]);
console.log(pets[3]);
...
//it should be like this