Skip to content

Commit 12c4bd9

Browse files
committed
Complete Day 9 - Dev Tools Domination
1 parent 0216eca commit 12c4bd9

3 files changed

Lines changed: 104 additions & 137 deletions

File tree

09 - Dev Tools Domination/index-FINISHED.html

Lines changed: 0 additions & 90 deletions
This file was deleted.

09 - Dev Tools Domination/index-START.html

Lines changed: 0 additions & 47 deletions
This file was deleted.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Console Tricks!</title>
6+
<link rel="icon" href="https://fav.farm/🔥" />
7+
</head>
8+
<body>
9+
10+
<p onClick="makeGreen()">×BREAK×DOWN×</p>
11+
12+
<script>
13+
const dogs = [{ name: 'Snickers', age: 2 }, { name: 'hugo', age: 8 }];
14+
15+
function makeGreen() {
16+
const p = document.querySelector('p');
17+
p.style.color = '#BADA55';
18+
p.style.fontSize = '50px';
19+
}
20+
21+
// Regular
22+
console.log('hello');
23+
24+
// Interpolated
25+
console.log('Hellow I am a %s string!', '💩')
26+
27+
// Styled
28+
//console.log('%c I am some great text', 'font-size: 50px; background: red; text-shadow: 10px 10px 0 blue;')
29+
30+
// warning!
31+
console.warn('OH NOOO');
32+
33+
// Error :|
34+
console.error('Shit!');
35+
36+
// Info
37+
console.info('Frank Lloyd Wright, Le Corbusier, and Zaha Hadid achieved legendary status without formal architecture degrees');
38+
39+
// Testing
40+
const p = document.querySelector('p');
41+
42+
console.assert(p.classList.contains('oww'), 'That is wrong!');
43+
44+
// clearing
45+
console.clear();
46+
47+
// Viewing DOM Elements
48+
console.log(p);
49+
console.dir(p);
50+
51+
console.clear();
52+
53+
// Grouping together
54+
dogs.forEach(dog => {
55+
console.group(`${dog.name}`);
56+
console.log(`This is ${dog.name}`);
57+
console.log(`${dog.name} is ${dog.age} years old`);
58+
console.log(`${dog.name} is ${dog.age * 7} dog years old`);
59+
console.groupEnd(`${dog.name}`);
60+
});
61+
62+
// counting
63+
console.count('Angela');
64+
console.count('Angela');
65+
console.count('Read');
66+
console.count('Read');
67+
console.count('Angela');
68+
console.count('Read');
69+
console.count('Angela');
70+
console.count('Read');
71+
console.count('Read');
72+
console.count('Read');
73+
console.count('Read');
74+
console.count('Read');
75+
76+
// timing
77+
console.time('fetching data');
78+
fetch('https://api.github.com/users/AngelaRead')
79+
.then(data => data.json())
80+
.then(data => {
81+
console.timeEnd('fetching data');
82+
console.log(data);
83+
})
84+
85+
console.table(dogs);
86+
87+
88+
const buildings = [{ name: 'Gehry Houe', year: 1978, location: 'Santa Monica, CA'},
89+
{ name: 'Museum of Pop Culture', year: 2000, location: 'Seattle, WA'},
90+
{ name: 'Louis Vuitton Foundation', year: 2014, location: 'Paris, France'}];
91+
92+
// Grouping together
93+
buildings.forEach(building => {
94+
console.group(`${building.name}`);
95+
console.log(`${building.name} was built in ${building.location}`);
96+
console.log(`${building.name} was completed in ${building.year}`);
97+
console.log(`${building.name} was supposed to completed by ${building.year - 3}`);
98+
console.groupEnd(`${building.name}`);
99+
});
100+
101+
console.table(buildings);
102+
</script>
103+
</body>
104+
</html>

0 commit comments

Comments
 (0)