This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const a = () => ( | |
| new Promise((res) => { | |
| console.log('-- a start'); | |
| setTimeout(() => { | |
| console.log('a'); | |
| res('-- a finish'); | |
| }, 1000) | |
| }) | |
| ) | |
| const b = () => ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function f(a) { | |
| return function(b) { | |
| console.log(a, b); | |
| } | |
| } | |
| var func = f('123'); | |
| func('321'); // 123 321 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var func = { | |
| f1: function() { | |
| console.log('f1', this); | |
| var sub = function () { | |
| console.log('sub', this); | |
| }; | |
| sub(); | |
| }, | |
| f2: () => { | |
| console.log('f2', this); |
NewerOlder