Skip to content
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
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>
</title>
</head>
<body>

<script type="text/javascript" src="js/app.js"></script>
</body>
</html>
68 changes: 68 additions & 0 deletions js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// COMPLETE ANY 3
console.log("test");
// Create an object that has a property that is an array. Log one of the elements of that array.
const objectWithPropertyArray = {
array: [1, 2, 3, 4]
}
console.log(objectWithPropertyArray.array[1]);

// Create an object that has a property that is an object. Log one of the properties of that inner object.
const objectWithObject = {
firstobject: "first object",
secondobject: [{
firstinside: "first inside"
}, {
secondinside: "second inside"
}]
};

console.log(objectWithObject.secondobject[0]);

// Create an object that has a property that is a function (method). Call that method.


// Create an array that has an object in it. Log one of the properties of that object.

// const arrayWithObjecttwo = {
// [{
// firstinside: "1",
// secondinside: "2"
// }
// {
// thirdtest: "1";
// }]

// };
// console.log(arrayWithObjecttwo[0]firstinside);
// Create an array that has an array as one of its elements. Log one of the elements of the inner array.

const firstArray = [1, 2, 3, 4,
[1, 2, 3, 4, 5]
, 6];
console.log(firstArray[3][4]);
// Create an array that has a function as one of its elements. Call that function.

// Create an object that has a property that is an array. Loop over the array and log each individual element.

// Create an array that has an array as one of its elements. Loop over the second array and log each individual element.

// Bonus: make each element of the outer array an array as well. Using two for loops, loop over each array in the outer array and log those elements.

//Pick three

// Create a function that returns an object. Log a property of that object (hint: call the function and then call a property on the return value).
// Create a function that returns an array. Log an element of the array.
// Create a function that returns an object that has an array. Log one of the elements of that array.
// Create a function that returns an object that has an object. Log one of the properties of the inner object.
// Create a function that returns an object that has a method. Call that inner function (method).
// Create a function that returns a function. Call that inner function
// Create an object that has a method that returns an object. Log a property of the inner object.
// Create an object that has a method that returns an object that has an array. Log an element of that array.
// Create an object that has a method that returns an object that has an object. Log a property of the inner object.
// Create an object that has a method that returns an object that has another method. Call the inner method.
// Create an object that has a method that returns a function. Call that function.
// Create an array that has a function that returns an object. Log a property of the object.
// Create an array that has a function that returns an object that has an array. Log an element of the inner array.
// Create an array that has a function that returns an object that has an object. Log a property of the inner object.
// Create an array that has a function that returns an object that has a method. Call that method.
// Create an array that has a function that returns a function. Call the inner function.