Guest User

Untitled

a guest
Jul 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. const getDateWithClosure = () => {
  2. const date = new Date();
  3.  
  4. const nestedFunction = () => {
  5. return date.getMilliseconds();
  6. };
  7.  
  8. return {
  9. foo: nestedFunction
  10. }
  11. }
  12.  
  13. const date2 = getDateWithClosure();
  14. console.log(date2.foo()); // 685
Add Comment
Please, Sign In to add comment