daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Mar 20th, 2019 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function test() {
  2.     var entries, event = {};
  3.  
  4.     entries = [ { x: 1 }, { x: 2 }, { x: 3 } ];
  5.     entries.forEach( function ( entry ) {
  6.         event = { value: entry };
  7.         defer( event );
  8.     } );
  9. };
  10. function defer( event ) {
  11.     setTimeout(function () {
  12.         console.log( event );
  13.     }, 1);
  14. }
  15. test();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top