質問するログイン新規登録

回答編集履歴

1

最近、typoひどい

2019/03/16 00:43

投稿

Lhankor_Mhy
Lhankor_Mhy

スコア37595

answer CHANGED
@@ -1,7 +1,7 @@
1
1
  async await で書くならこうでしょうか。(動作未確認)
2
2
  ```js
3
3
  function getLocation(city) {
4
- retern fetch(`https://cors-anywhere.herokuapp.com/www.metaweather.com/api/location/search/?query=${city}`)
4
+ return fetch(`https://cors-anywhere.herokuapp.com/www.metaweather.com/api/location/search/?query=${city}`)
5
5
  .then(result => {
6
6
  return result.json();
7
7
  })
@@ -29,7 +29,7 @@
29
29
  then でつなぐならこうでしょうか。(動作未確認)
30
30
  ```js
31
31
  function getLocation(city) {
32
- retern fetch(`https://cors-anywhere.herokuapp.com/www.metaweather.com/api/location/search/?query=${city}`)
32
+ return fetch(`https://cors-anywhere.herokuapp.com/www.metaweather.com/api/location/search/?query=${city}`)
33
33
  .then(result => {
34
34
  return result.json();
35
35
  })