From ef28aafda16e654522a5b32ec36e6310f814b90f Mon Sep 17 00:00:00 2001 From: angel Date: Mon, 27 Oct 2025 12:26:06 -0500 Subject: [PATCH] Upload files to "arrays" --- arrays/Example1.js | 8 +++++++ arrays/Example2.js | 23 ++++++++++++++++++ arrays/Example3.js | 59 ++++++++++++++++++++++++++++++++++++++++++++++ arrays/Example4.js | 32 +++++++++++++++++++++++++ arrays/Example5.js | 24 +++++++++++++++++++ 5 files changed, 146 insertions(+) create mode 100644 arrays/Example1.js create mode 100644 arrays/Example2.js create mode 100644 arrays/Example3.js create mode 100644 arrays/Example4.js create mode 100644 arrays/Example5.js 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