Skip to content

Commit b246aba

Browse files
committed
ESLint
1 parent ab2cb26 commit b246aba

File tree

3 files changed

+75
-1
lines changed

3 files changed

+75
-1
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
const people = [
2+
{ name: 'Wes', cool: true, country: 'Canada' },
3+
{ name: 'Scott', cool: true, country: 'Merica' },
4+
{ name: 'Snickers', cool: false, country: 'Dog Country' },
5+
];
6+
7+
people.forEach((person, index) => {
8+
console.log(person.name);
9+
});
10+
11+
// Console Methods
12+
13+
// Callstack
14+
15+
// Grabbing Elements
16+
17+
// Breakpoints
18+
19+
// Scope
20+
21+
// Network Requests
22+
23+
// Break On Attribute
24+
25+
// Some Setup Code
26+
27+
function doctorize(name) {
28+
return `Dr. ${name}`;
29+
}
30+
31+
function greet(name) {
32+
doesntExist();
33+
return `Hello ${name}`;
34+
}
35+
36+
function go() {
37+
const name = doctorize(greet('Wes'));
38+
console.log(name);
39+
}
40+
41+
const button = document.querySelector('.bigger');
42+
button.addEventListener('click', (e) => {
43+
const newFontSize =
44+
parseFloat(getComputedStyle(e.currentTarget).fontSize) + 1;
45+
e.currentTarget.style.fontSize = `${newFontSize}px`;
46+
});
47+
48+
// A Dad joke fetch
49+
async function fetchDadJoke() {
50+
const res = await fetch('https://icanhazdadjoke.com/', {
51+
headers: {
52+
Accept: 'text/plain',
53+
},
54+
});
55+
const joke = await res.text();
56+
console.log(joke);
57+
return joke;
58+
}

playground/scope.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,10 @@
1111
<body>
1212

1313
</body>
14+
<script src="./scope.js">
15+
</script>
16+
<script>
17+
sayHi();
18+
</script>
1419

15-
</html>
20+
</html>

playground/scope.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const age = 100;
2+
3+
function go() {
4+
const age = 200;
5+
const hair = 'blonde';
6+
console.log(age);
7+
console.log(hair);
8+
}
9+
10+
go();
11+
console.log(age);

0 commit comments

Comments
 (0)