Created
April 4, 2016 22:51
-
-
Save richistron/0da286585835df49751eb6d5826c2e5f to your computer and use it in GitHub Desktop.
Pregunta de javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quiero crear un loop que corra cada 1000 miliseconds, pero que espere a que | |
// el anterior termine | |
// incorrecto: http://g.recordit.co/p8ssRrRY27.gif | |
// correcto: http://g.recordit.co/OFFYS9Nd6F.gif | |
function doStuff(){ | |
setTimeout(function(){ | |
console.log('done doing stuff'); | |
}, 3000); | |
}; | |
!function(){ | |
setInterval(function(){ | |
console.log('do stuff start'); | |
doStuff(); | |
}, 1000); | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment