Feb 21, 2021
Hi! I'm glad you liked it!
This line uses the test() method on the error message. The "human readable" error will be stored in err.message.
If the message does not include "already exists", we show the error message. You can read more about this method here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test