Link to codepen with my code. (the three versions of the solution are separated by comments).
There are some things I still don’t understand. For instance, the use of the response parameter. I used anonymous functions inside the .thens and it still works.
I made it work in general but I still don’t fullt grasp what’s going on, which I guess might reflect in my code.
Very well done! I had a look at all three version and you wrote good code.
You could make the second version simpler by removing the return keyword and the curly braces. This works because when having an arrow function the last statement executed is automatically the return value and when you have only one statement you don’t need curly braces.
Version 3 could be made easier because we don’t need the resolved value but just need to wait until the promise is fulfilled (as explained in the other post).