Skip to content

Instantly share code, notes, and snippets.

View melashu's full-sized avatar
🖐️
Open to new opportunities

Meshu melashu

🖐️
Open to new opportunities
View GitHub Profile
View example1.js
const pets = ['Cat', 'Dog', 'Bird', 'Fish', 'Frog', 'Hamster', 'Pig', 'Horse', 'Lion', 'Dragon'];
console.log(pets[0]);
console.log(pets[1]);
console.log(pets[2]);
console.log(pets[3]);
//This code cant fullfil DRY. The code is repeated but we can minimize it. The following code snippt
//is the DRY vesrion of the above code.
for(let i=0;i<pets.length;i++){