Created
May 2, 2022 10:34
Revisions
-
ndayishimiyeeric created this gist
May 2, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ The Code in the example 1 is not DRY Because there repetition. below there is the atleast DRY Code of javascript. const pets = ['Cat', 'Dog', 'Bird', 'Fish', 'Frog', 'Hamster', 'Pig', 'Horse', 'Lion', 'Dragon']; //Print all pets pets.forEach((pet) => console.log(pet)); below there is it atleast dry code of css. .cat, .dog, .dragon { font-family: "Times New Roman", Times, serif; font-size: 1rem; color: #FFF; } .dog { color: #000; } .dragon { color: #009933; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ const greet = (message, name) => { console.log(`${message}, ${name}!`) } greet('Hello', 'John'); greet('Hola', 'Antonio'); greet('Ciao', 'Luigi') .greetings { font-family: Arial, sans-serif; font-size: 1.5rem; } .greetings.english { background-color: #000; color: #FFF; } .greetings.spanish { background-color: #FFF; color: #000; } The code in the example 2 is DRY there is no repetition of line of codes both is JS and CSS