1function myClick() {
2 setTimeout(
3 function() {
4 document.getElementById('div1').style.display='none';
5 document.getElementById('div2').style.display='none';
6 }, 5000);
7}
1function doHomeWork(subject, callback){
2 setTimeout(callback,500);
3 console.log("doing my homework:", subject)
4}
5
6doHomeWork("Maths", function(){console.log("finished my homework");});
7