aquaballoon

Node.js - Callback function

Jul 7th, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.12 KB | None | 0 0
  1. var x = 1;
  2. var foo = function(callbackfn) {
  3.     return callbackfn(x * 2);
  4. };
  5.  
  6. foo(function(x) {
  7.     console.log(x);
  8. });
Advertisement
Add Comment
Please, Sign In to add comment