lesson-9 testing questions
#2466
-
We are writing the code in What's a And How did we get |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
@krakxn You think you could help me with answers? :) |
Beta Was this translation helpful? Give feedback.
-
Hey @MasterofBlockchain the Concerning the "listener" a listener is in simple terms a function that "listens" for or waits for a certain event to occur so that we can perform some actions. Javascript and Node.js in this case provides us with listerners that we can use. There is |
Beta Was this translation helpful? Give feedback.
Hey @MasterofBlockchain the
try--catch
block is mainly useful because it lets us handle the error and terminate the program execution gracefully. When using the normal program flow, if an error is thrown the program abruptly ends and prints out the error. However when we use atry...catch
block it gives us control on what to do when an error occurs. Say we don't want to see the error log, we could just say that if an error occurs prints a specific error message or a shortened version of the error or just a statement likean error occured
. Additionally, we could do other things like run a specific function if a certain specific error occurs among other things. Using atry...catch
gives us …