From a70f5291ddaaf2c1a11c783b062c92abb8f0f6e2 Mon Sep 17 00:00:00 2001 From: Chris Roman Date: Fri, 21 Sep 2018 09:58:43 -0500 Subject: [PATCH 1/2] commit 1 - combine objects,arrays, and functions --- app.js | 35 +++++++++++++++++++++++++++++++++++ index.html | 9 +++++++++ 2 files changed, 44 insertions(+) create mode 100644 app.js create mode 100644 index.html diff --git a/app.js b/app.js new file mode 100644 index 0000000..4f9f790 --- /dev/null +++ b/app.js @@ -0,0 +1,35 @@ +console.log('It works'); + + + +// Create an object that has a property that is an array. Log one of the elements of that array. + +const person = { + pets: ['Cat', 'Fish', 'Dog'] +} + +console.log(person.pets[2]); + + +// Create an array that has an array as one of its elements. Log one of the elements of the inner array. + +const arrElements = [['dog', 'cat', 'bird'], 'fish', 'animal'] + +console.log(arrElements[0][2]) + +// Create an object that has a property that is an array. Loop over the array and log each individual element. + +const arrLoop = [['dog', 'cat', 'bird'], 'fish', 'animal'] + +for(let i = 0; i < arrLoop[0].length; i++){ + console.log(arrLoop[0][i]) +} + + + + + + + + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..dc738e6 --- /dev/null +++ b/index.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file From b56c74be3621a383a80f81f3b73f00a323bea8c3 Mon Sep 17 00:00:00 2001 From: Chris Roman Date: Fri, 21 Sep 2018 10:00:27 -0500 Subject: [PATCH 2/2] pretty sure I failed --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 4f9f790..86e2809 100644 --- a/app.js +++ b/app.js @@ -25,7 +25,7 @@ for(let i = 0; i < arrLoop[0].length; i++){ console.log(arrLoop[0][i]) } - +// Fairly certain I failed this quiz....