Guest User

Untitled

a guest
May 28th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. function f(key, val) {
  2. return function(k) {
  3. if (k === key) { return val; }
  4. else return undefined;
  5. };
  6. };
  7. var o = f(1, 2);
  8.  
  9. // what value does each alert?
  10. alert(o(1));
  11. alert(o(2));
Add Comment
Please, Sign In to add comment