settimeout inside function code example
Example 1: settimeout function
setTimeout(function(){
$('#overlay'). modal('hide')
}, 5000);
//#overlay will be the ID of modal which you want to hide or show modal
Example 2: js after settimeout
function doHomeWork(subject, callback){
setTimeout(callback,500);
console.log("doing my homework:", subject)
}
doHomeWork("Maths", function(){console.log("finished my homework");});