Created
March 6, 2023 14:44
-
-
Save ahmed025566/db276c3d1744f1d42b14e2fbbcb9c04d to your computer and use it in GitHub Desktop.
Revisions
-
ahmed025566 created this gist
Mar 6, 2023 .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,11 @@ 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]); .... It is not DRY and here you can see how to make it DRY : pets.forEach((item) => console.log(item))