()
| 5 | const link = `https://api.quotable.io/random`; |
| 6 | |
| 7 | function getQuote(){ |
| 8 | fetch(link) |
| 9 | .then(response => { |
| 10 | let data = response.json(); |
| 11 | return data; |
| 12 | }) |
| 13 | .then(data => { |
| 14 | quoteElement.innerText = `“${data.content}”`; |
| 15 | authorElement.innerText = `―${data.author}`; |
| 16 | }) |
| 17 | .catch(error => { |
| 18 | console.log(error); |
| 19 | }); |
| 20 | } |
| 21 | |
| 22 | window.addEventListener('load', getQuote); |
nothing calls this directly
no outgoing calls
no test coverage detected