Skip to content

Instantly share code, notes, and snippets.

View MPDADDY's full-sized avatar

Anold Mwagharo MPDADDY

View GitHub Profile
@MPDADDY
MPDADDY / example1.js
Created August 28, 2023 13:47
Assessing a piece of code if it is DRY
const pets = ['Cat', 'Dog', 'Bird', 'Fish', 'Frog', 'Hamster', 'Pig', 'Horse', 'Lion', 'Dragon'];
// Print all pets
console.log(pets[0]);
console.log(pets[1]);
console.log(pets[2]);
console.log(pets[3]);
...
//This code is not DRY because accessing the pets array and consolling each pet one by one is repeatetive activity and can be avoided by looping through the array.
{
"connector": {
"name": "local",
"options": {
"pattern": ["**", "!.git/**", "!node_modules/**"]
}
},
"extends": ["development"],
"formatters": ["stylish"],
"hints": [