Skip to content

Commit

Permalink
Fix small typos
Browse files Browse the repository at this point in the history
  • Loading branch information
sadiqui authored Oct 10, 2024
1 parent b7df344 commit 0eba3e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subjects/sortable/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ You must write all of the code from scratch. You are not allowed to rely on any

#### Fetching the data
In order to get the information, you should use `fetch`.
When you use `fetch` in JS, it always returns a `Promise`. We will look more deeply into that later on. For now, tak a look at this:
When you use `fetch` in JS, it always returns a `Promise`. We will look more deeply into that later on. For now, take a look at this:

```js
// This function is called only after the data has been fetched, and parsed.
const loadData = heroes => {
console.log(heroes)
}

// Request the file with fetch, the data will downloaded to your browser cache.
// Request the file with fetch, and the data will be downloaded to your browser cache.
fetch('https://rawcdn.githack.com/akabab/superhero-api/0.2.0/api/all.json')
.then((response) => response.json()) // parse the response from JSON
.then(loadData) // .then will call the `loadData` function with the JSON value.
Expand Down

0 comments on commit 0eba3e1

Please sign in to comment.