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
2 changes: 1 addition & 1 deletion 01_05/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Console demo</title>
<script src="script.js" defer></script>
</head>
<body></body>
<script src="script.js" defer></script>
</html>
2 changes: 1 addition & 1 deletion 02_02/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Module demo</title>
<script src="script.js"></script>
</head>
<body></body>
<script src="script.js"></script>
</html>
2 changes: 2 additions & 0 deletions 03_05/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ const backpack = {
this.strapLength.right = lengthRight;
},
};

console.log("The backpack object:", backpack);
1 change: 1 addition & 0 deletions 03_06/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ const backpack = {
};

console.log("The backpack object:", backpack);
console.log("The pocketNum value:", backpack.pocketNum);
9 changes: 8 additions & 1 deletion Practice/03_07/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@
<title>Practice: Making Objects</title>
<script src="script.js" defer></script>
</head>
<body></body>
<body>
<h2>Gaming pc:</h2>
<div id="gamingPcDiv"></div>
<p>
This is my current Gaming PC Specs for now, updates will come in the
future.
</p>
</body>
</html>
23 changes: 23 additions & 0 deletions Practice/03_07/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,26 @@
* - Find an object that has another object inside of it to create a nested object.
* - Test your objects in the browser console by accessing the entire object and its specific properties.
*/

// This is an object:

const gamingPc = {
processor: "Amd",
grapicsCard: "Nvidia",
ram: "32gb",
motherBoard: "asus",
fans: "8",
powerSupplay: "1200w",
};

//Getting the div:
const showPcSpec = document.getElementById("gamingPcDiv");

// Displaying the object in HTML:
showPcSpec.innerHTML = ` <p><strong>Processor:</strong> ${gamingPc.processor}</p>
<p><strong>Grapicscard:</strong> ${gamingPc.grapicsCard}</p>
<p><strong>Ram:</strong> ${gamingPc.ram}</p>
<p><strong>Motherboard:</strong> ${gamingPc.motherBoard}</p>
<p><strong>Fans:</strong> ${gamingPc.fans}</p>
<p><strong>Powersupplay:</strong> ${gamingPc.powerSupplay}</p>
`;
17 changes: 17 additions & 0 deletions Practice/03_09/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,20 @@ const backpack = {
this.strapLength.right = lengthRight;
},
};

// Using my object from example 03_07 file:
const gamingPc = {
processor: "Amd",
grapicsCard: "Nvidia",
ram: "32gb",
motherBoard: "asus",
fans: "8",
powerSupplay: "1200w",
method: function (ram) {
this.ram = ram;
},
};

gamingPc.method("64bg");

console.log(gamingPc.ram);
Loading