Promise - 嵌套函数不起作用

0
39005 次浏览

我想知道为什么以下代码不起作用,毕竟它只是嵌套函数:

var calculus = new Promise((resolve, reject) => (resolve) => resolve(3))

var calculus2 = new Promise((resolve, reject) => {
  () => resolve(4)
})

calculus.then((result) => console.log(result))
calculus2.then((result) => console.log(result))

 

请尽量让自己的答案能够对别人有帮助

52个答案

默认排序 按投票排序
0

Your article is awesome. I enjoyed reading your article. This is really a great document for me. I have bookmarked it and I am looking forward to reading new articles. Please continue to uphold!

Little Alchemy

0

您要扩展的完成代码基于bashcompinit。结果,您需要将代码编写为Bash完成函数。这意味着您应该将完成匹配项添加到数组中COMPREPLY。由于函数返回时该数组为空,因此 pg slot _bash_complete向Zsh报告_main_complete失败。

0

I hope that someone will help you on fixing that code about nested function. fort worth welding companies

0

Thank you. It was great to see useful information. Please visit my site next time. plasterer sydney

0

lead generation Great Information sharing .. I am very happy to read this article .. thanks for giving us go through info.Fantastic nice

0

This place is nice, but not nice enough to die in. Let's kill them and get out.

0

Your website is very good, the content is original, unique and interesting. Thank you very much for sharing this wonderful information. Very interesting topic.ทางเข้าjoker

0

เราเป็นผู้ให้บริการที่มีตัวเกมส์สล็อตให้เลือกเล่นจำนวนมากเพราะเรามีการพัฒนาเกมใหม่เพื่อเอาใจและตอบสนองความต้องการของผู้เล่นตลอดเวลาเราได้เลือกเกมยอดนิยมจากผู้เล่นมาส่วนหนึ่ง เพื่อเป็นแนวทางสำหรับผู้เล่นเกมหน้าใหม่หรือเพื่อเปิดทางให้กับผู้เล่นเกมส์สล็อตเก่า ๆ ที่อาจจะกำลังมองหาเกมส์ใหม่ ๆ เล่นเกมเรามีเว็บที่ดีที่สุดในตอนนี้มาแนะนำ
https://www.xosuperslot.com
https://www.xopgth.com/
https://xojoker.com/
https://www.xoautobet.com/
https://www.xogclubth.com/

0

what a nice weather we have

0

Click here to check more services of our site, read more on how to do your own DIY projects.

0

I am also very interested in this issue and find many very good. thank you very much!

t rex run

0

I really love reading your blog. It is very well composed and easy to understand. Thanks very much!

usa map

0

Development and operation of oil and gas assets can contribute positive social gains to local, regional and national communities. 

https://www.prpremium.ca/kindersley.html

0

Great article for blog posting and commenting. Nice work! 
https://www.sasktreepros.com/

0

这只能说明网约车是出行领域的网红,而不能说明其不安全彩票。尽管网约车仅诞生3年,但其市场影响力和媒体关注度一直居高不下,令出租车、黑车无法望其项背。
        众所周知,网约车的火爆对出租车产生一定的冲击福彩双色球,但这属于市场公平竞争的结果,很多出租车轴距没达到2700毫米也没人质疑不安全,所以我呼吁监管部门网约车幸运飞艇、出租车应一视同仁,不应为了保护既得利益而巧立名目来打压新生事物,以限制其正常发展。

0

是一个对象,它代表了一个异步操作的最终完成或者失败。因为大多数人仅仅是使用已创建的 Promise 实例对象,所以本教程将首先说明怎样使用 Promise,再说明如何创建 Promise。pgslot

0

You write well I really like what you write. I would like to recommend my website. If it doesn't bother much, please It is the most modern casino and also has a 24-hour automatic deposit-withdrawal system if you are looking for an online casino website. This website is the number 1 site in the casino field, with many games for you to choose from joker gaming pgslot sexygame

0

Interesting post!!! thanks for this <a href="https://blacksheepdigital.ca/">Digital Marketing Vancouver, BC</a>

1 2 3