MCPcopy Create free account
hub / github.com/AyushSaini00/60minuteJavaScript / getQuote

Function getQuote

Quotes-Generator/app.js:7–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5const link = `https://api.quotable.io/random`;
6
7function 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
22window.addEventListener('load', getQuote);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected