javascript log error without traceback

Solutions on MaxInterview for javascript log error without traceback by the best coders in the world

showing results for - "javascript log error without traceback"
Amaris
30 Aug 2017
1try {
2  // code that throws error
3  throw new Error("The message");
4} catch (error) {
5  // this will log just the error's message
6  console.error(error.message);
7}
8
9// output: "The message"