+ 3
Pls why do I get null as the output on the console?
I want to log 40 as a value on the console using the code(javaScript) https://code.sololearn.com/WtcAe23Re63j/?ref=app
8 ответов
+ 1
When i chain than and catch uncaught(in promise) disapire and error is catched. Dont know why it work with chain but dont work in way you tried first. It look like we need to use this syntax
https://code.sololearn.com/WhXv3zy8z1FV/?ref=app
+ 4
On line 7 You wrote:
resolve(add((multiply(5,6),10)));
That is actually one more pair of () than what You need. It should like this:
resolve(add(multiply(5,6),10));
And then Your output should be 40.
Furthermore I recommend formatting Your code better. Use spaces after commas, spaces after the "=>" and either use semicolons or don't.
+ 2
There is more "()" than needed in your line 7
https://code.sololearn.com/W8IF180vp8rl/?ref=app
+ 2
Wow! I am proud to be a member of this community, you are such a wonderful and supportive people. Thanks a lot for your contributions
+ 1
@Sanja Panic , what I meant is that the system says there is error in line 1(Promise). Of course I expect to see the reject value passed as the argument to the .catch()
+ 1
@Sanja Panic, thanks a lot for your help, I really appreciate it. Any time you find the reason for that, please let me know.
0
Pls why do I get null as the output on the console? Thanks for resolving the issue. I noticed an error message when the promise is being rejected, please how do I solve that?
I want to log 40 as a value on the console using the code(javaScript)
https://code.sololearn.com/WtcAe23Re63j/?ref=app
0
okafor okwuchukwu charisma you check arr.length to be bigger than 5, but arr.length is 3. So this will show your reject code