Created
September 7, 2017 14:25
-
-
Save LoLei/2369be1f859e6e551dd100f87f920277 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/kiwodam
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
var loop = function(i, array) { | |
console.log(array[i]); | |
save(array[i],function(){ | |
var increment = 10; | |
i++; | |
if (i < array.length) { | |
for (j = i; (j < i + increment) && (j < array.length); j++) { | |
loop(j, array); | |
} | |
} | |
}); | |
} | |
console.log("start"); | |
var array = []; | |
for (var j = 0; j < 1000; j++) { | |
array.push(j); | |
} | |
var i = 0; | |
loop(i, array); | |
console.log("end"); | |
function save(x,callback) { | |
// code to show your custom alert | |
// in this case its just a console log | |
console.log("Done saving: " + x); | |
// do callback when ready | |
callback(); | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var loop = function(i, array) { | |
console.log(array[i]); | |
save(array[i],function(){ | |
var increment = 10; | |
i++; | |
if (i < array.length) { | |
for (j = i; (j < i + increment) && (j < array.length); j++) { | |
loop(j, array); | |
} | |
} | |
}); | |
} | |
console.log("start"); | |
var array = []; | |
for (var j = 0; j < 1000; j++) { | |
array.push(j); | |
} | |
var i = 0; | |
loop(i, array); | |
console.log("end"); | |
function save(x,callback) { | |
// code to show your custom alert | |
// in this case its just a console log | |
console.log("Done saving: " + x); | |
// do callback when ready | |
callback(); | |
}</script></body> | |
</html> |
This file contains 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
var loop = function(i, array) { | |
console.log(array[i]); | |
save(array[i],function(){ | |
var increment = 10; | |
i++; | |
if (i < array.length) { | |
for (j = i; (j < i + increment) && (j < array.length); j++) { | |
loop(j, array); | |
} | |
} | |
}); | |
} | |
console.log("start"); | |
var array = []; | |
for (var j = 0; j < 1000; j++) { | |
array.push(j); | |
} | |
var i = 0; | |
loop(i, array); | |
console.log("end"); | |
function save(x,callback) { | |
// code to show your custom alert | |
// in this case its just a console log | |
console.log("Done saving: " + x); | |
// do callback when ready | |
callback(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment