Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quiz #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -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])
}

// Fairly certain I failed this quiz....







9 changes: 9 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript" src="app.js"></script>
</body>
</html>