Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var promise = new Promise(function(resolve, reject) {
- function Func(){
- let y=0;
- for (let i = 1;i<100000000;i++){
- y++;
- }
- console.log(y)
- return y;
- }
- resolve(Func) // y
- })
- // promise.then(r => console.log(r+1))
- promise.then(r => r())
- console.log('Hello, world!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement