diff --git a/arrays/Example1.js b/arrays/Example1.js new file mode 100644 index 0000000..6e579a0 --- /dev/null +++ b/arrays/Example1.js @@ -0,0 +1,8 @@ + +// creating an array of strings +let animals = ["Zebra", "Koala", "Lion", "Elephan", "Eagle"] + +// displaying the items stored in array animals +console.log(animals) + +console.log("\narray contains "+ animals.length +" items") diff --git a/arrays/Example2.js b/arrays/Example2.js new file mode 100644 index 0000000..813d029 --- /dev/null +++ b/arrays/Example2.js @@ -0,0 +1,23 @@ + + + + +// creating an array of strings +let animals = ["Zebra", "Koala", "Lion", "Elephan", "Eagle"] + +// displaying the items stored in array animals using a for loop +for(let i=0; i