MCPcopy Create free account
hub / github.com/codemistic/Web-Development / generateJoke

Function generateJoke

dad jokes/script.js:9–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8// USING ASYNC/AWAIT
9async function generateJoke(){
10
11 const config = {
12 headers: {
13 'Accept': 'application/json'
14 }
15 }
16 const res = await fetch('https://icanhazdadjoke.com', config)
17
18 const data = await res.json()
19
20 jokeEl.innerHTML = data.joke
21}
22
23
24// USING .then

Callers 1

script.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected