Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const getDateWithClosure = () => {
- const date = new Date();
- const nestedFunction = () => {
- return date.getMilliseconds();
- };
- return {
- foo: nestedFunction
- }
- }
- const date2 = getDateWithClosure();
- console.log(date2.foo()); // 685
Add Comment
Please, Sign In to add comment