scrimba
Asynchronous JavaScript
Callback Coding Challenge II
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Callback Coding Challenge II
by
AboutCommentsNotes
Callback Coding Challenge II
by
Expand for more info
index.js
run
preview
console
//callback coding challenge II
const country = [
{'name': 'China', 'City': 'Beijing'},
{'name': 'USA', 'City': 'Washington D.C'},
{'name': 'Nigeria', 'City': 'Lagos'}

]

function Country () {
setTimeout(()=>{
let result =''
country.forEach((nation)=>{
result+= `<table> <tr> <td><li> ${nation.name} </li>
<td> <li> ${nation.City} </li> </tr></td></table>
`
})
document.getElementById('show').innerHTML = result
}, 1000

)
}

//use call back function to push a new country and city to the browser
//with 3 seconds wait time.




Console
/index.html
-1:17