前提・実現したいこと
クイズデータのAPIから、特定のデータを抽出したいです。
発生している問題・エラーメッセージ
undefined
該当のソースコード
fetch('https://opentdb.com/api.php?amount=10') .then(response => response.text()) .then(text => { console.log(text); // OK console.log(text.results); // NG console.log(text.results[0].question); // NG });
試したこと
text.resultsなど、色々試しましたが、データが抽出できません。
補足情報(FW/ツールのバージョンなど)
Chrome。Windows、
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/05/25 09:47
2019/05/25 09:48
2019/05/25 11:00