od0201,
<html>
<body>
<div>1</div>
<div>2</div>
<div>3</div>
<p>start</p>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script>
let map = $("div").map((i,e)=> {
let d = $.Deferred();
setTimeout(() => {$(e).css('background','red' ), d.resolve();} , (i+2)*500)
return d
})
$.when(...map).done(() => $('p').text('finish') )
</script>
</body>
</html>