Skip to content

Instantly share code, notes, and snippets.

View mekdev's full-sized avatar

Mek Stittri mekdev

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mekdev on github.
  • I am mekdev (https://keybase.io/mekdev) on keybase.
  • I have a public key ASAMNwWAbHe70BKZfp_f_peURNM8wPyhLfA0_s7cxyEb3Ao

To claim this, I am signing this object:

@mekdev
mekdev / javascript-async.js
Last active June 16, 2016 01:11
Javascript asynchronous
var source = ['foo', 'bar', 'baz'];
var result = [];
setTimeout(function () {
for (var i = 0 ; i < source.length ; i++) {
console.log('Stepping through : ' + source[i]);
result.push(source[i]);
console.log('Current result: ' + result);
}
}, 1000); // Wait 1000 ms to finish operation