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))

 

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

41个答案

默认排序 按投票排序
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>

0

The information you share is very interesting
hotmail login

0

I thought I am the only one who experience this nested function error or bug. Cedar Rapids certified electrician offers an affordable but quality service for all your electric repair and installation needs

0

Your article is very useful, the content is great, I have read a lot of articles, but for your article, it left me a deep impression, thank you for sharing. happy wheels

0

Discover a roofer Close to you in Independence, Iowa.Go within the best level of our elite organized work. Get a cite for roof repair or substitution from one of our material temporary workers.

0

Studied genuine audits and see evaluations for Laredo, TX Power Washers for complimentary! This list will assist you choose the correct professional Pressure Washing Benefit in Laredo, TX.

0

Good post. I agree with the author's sharp point word unscrambler

0

I really like reading through a post that can make people think. Also, many thanks for permitting me to comment! run 3

0

Do you check the keys yet? These keys are very delicate. You have to look slotxo carefully. Check carefully that you write correctly and completely or not. You are wrong size space. It will not be able to display your code. Try to check

0

Nice code! Glad I found the solution here! Thanks for sharing. towing Vienna VA

0

Interesting equation! Thanks for sharing this site! shed builder Springfield VA

1 2 3