Skip to content

Commit 8bf46eb

Browse files
committed
feat: Output count of times ranked for the perf text
1 parent ce3b5b2 commit 8bf46eb

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

06 - Type Ahead/day-06.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Type Ahead 👀</title>
6+
<link rel="stylesheet" href="style.css">
7+
</head>
8+
<body>
9+
10+
<form class="search-form">
11+
<input type="text" class="search" placeholder="City or State">
12+
<ul class="suggestions">
13+
<li>Filter for a city</li>
14+
<li>or a state</li>
15+
</ul>
16+
</form>
17+
<script src="day-06.js"></script>
18+
</body>
19+
</html>

06 - Type Ahead/day-06.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Get the data
2+
const endpoint = 'https://gist.githubusercontent.com/Miserlou/c5cd8364bf9b2420bb29/raw/2bf258763cdddd704f8ffd3ea9a3e81d25e2c6f6/cities.json';
3+
4+
// Create an empty array for the cities
5+
const cities = [];
6+
7+
// Promises return as a promise
8+
// const prom = fetch(endpoint);
9+
// console.clear();
10+
// console.log(prom);
11+
12+
fetch(endpoint)
13+
.then(blob => blob.json())
14+
.then(data => cities.push(...data))
15+
16+
console.clear();
17+
console.log(cities);

0 commit comments

Comments
 (0)