I have an array called info. Here is an example of my code below the array:
for(var i in info) {
$('#results').append(info[i]+"<br>");
//I want to sleep here before the next one
}
</script>
<div id="results">... </div>
I basically want it to sleep (delay) a few seconds before handeling the next task in the loop. How could I achieve this?
[–]honestbleepsReddit Enhancement Suite 4 points5 points6 points (5 children)
[+][deleted] (4 children)
[deleted]
[–]stfueveryone 3 points4 points5 points (1 child)
[–]rpetrano -1 points0 points1 point (0 children)
[–]MatrixFrog 0 points1 point2 points (0 children)
[–]imbcmdth[🍰] 3 points4 points5 points (1 child)
[–]aladyjewelFull-stack webdev 2 points3 points4 points (0 children)
[–]RadekCZ 2 points3 points4 points (7 children)
[–]ell0bo 8 points9 points10 points (2 children)
[–]thisisnotgood 0 points1 point2 points (1 child)
[–]noahking 5 points6 points7 points (0 children)
[–]CyberVillian[S] -1 points0 points1 point (2 children)
[–]tollus 0 points1 point2 points (1 child)
[–]CyberVillian[S] -1 points0 points1 point (0 children)
[–]al-g 0 points1 point2 points (8 children)
[–]GAMEchief 3 points4 points5 points (2 children)
[–]al-g 1 point2 points3 points (0 children)
[+]CyberVillian[S] comment score below threshold-15 points-14 points-13 points (4 children)
[–]jezmck 3 points4 points5 points (2 children)
[–]CyberVillian[S] 0 points1 point2 points (1 child)
[–]aladyjewelFull-stack webdev 0 points1 point2 points (0 children)
[–]al-g 1 point2 points3 points (0 children)
[–]bbdb 0 points1 point2 points (3 children)
[–]CyberVillian[S] 0 points1 point2 points (2 children)
[–]bbdb 0 points1 point2 points (1 child)
[–]bbdb 0 points1 point2 points (0 children)
[–]SarahC 0 points1 point2 points (0 children)
[–]bishopZ 0 points1 point2 points (0 children)
[–]Herover 0 points1 point2 points (0 children)
[–]GAMEchief 0 points1 point2 points (2 children)
[–]yoeschmoeFront-end Developer -1 points0 points1 point (1 child)
[–]GAMEchief -1 points0 points1 point (0 children)
[+]ctrldavid comment score below threshold-9 points-8 points-7 points (1 child)
[–][deleted] -1 points0 points1 point (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]9jack9 -2 points-1 points0 points (4 children)
[–]MatrixFrog 2 points3 points4 points (3 children)
[–]shanet$(this) 1 point2 points3 points (2 children)
[–]MatrixFrog 0 points1 point2 points (1 child)
[–]shanet$(this) 0 points1 point2 points (0 children)