Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. function callback(n) {
  2. console.log(n);
  3. }
  4.  
  5. function getN(callback) {
  6. var n=0;
  7.  
  8. get('data', {num:10}, function(res) {
  9. n=n*res;
  10. });
  11.  
  12. setTimeout(function() {
  13. n=n*2;
  14. },0);
  15.  
  16. n=n+2;
  17. callback(n);
  18. };
  19. getN(callback);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement