last day (15 days later) » 

10:32 AM
Hey Patrick
Do you remember me? You have answered my question about asynchronous javascript yesterday.
I saw your profile and I thought I can ask a question to you about that topic.
It's actually more about code review.
The question I asked yesterday: stackoverflow.com/questions/67541321/…
I tried to change one of my helper functions that only calculates the size of a directory. It's original code was like that:
This old version has a callback hell as you can see, so many nested if/else and callback functions.
And this is the new version of that helper function:
This doesn't look very different but it's all based on promises.
I tried to change my code like the third code block on your answer.
I didn't include many error handlings but it ended up like that.
Does my new code looks fine? What do you think about it? How would you code it?
Thanks in advance.
Update: I have updated my code a little bit and it looks better.
 
 
4 hours later…
2:27 PM
You should post an actual question and include the code as text rather than an image. If the code is working as-is, you'll get much more thorough feedback on codereview.stackexchange.com. Make sure it's actually working as you expect though, they're very strict about that on there.
 

last day (15 days later) »