Whenever you see someFunction(...).then(...)
(And may be followed with .catch(...) To handle errors)
That means:
someFunctionreturns aPromisethen(...)handles the promise once it is fulfilled (orresolved)catch(...)handles the error (if one occurs during the promise) (e.g. when it isrejected)