Skip to content

Just Questions about Java Script #2543

Answered by krakxn
TimeKeyRoll asked this question in Q&A
Discussion options

You must be logged in to vote

"listener has try Catch" In the try-catch, the try block has no functionality whatsoever, only the catch block is used, and serves to "catch" (also rejects for the promise) any error caught on evaluation. Additionally, even if the try block contained some logic, it is not inclusive of the listener.

Therefore, the promise checks whether the listener itself resolves or rejects.

Of course, you can also do a big try block but promises are more versatile.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@TimeKeyRoll
Comment options

@krakxn
Comment options

Comment options

You must be logged in to vote
1 reply
@TimeKeyRoll
Comment options

Answer selected by alymurtazamemon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants