JavaScript
32.1K subscribers
1.06K photos
10 videos
33 files
737 links
A resourceful newsletter featuring the latest and most important news, articles, books and updates in the world of #javascript 🚀 Don't miss our Quizzes!

Let's chat: @nairihar
Download Telegram
CHALLENGE

class CustomError extends Error {
constructor(message) {
super(message);
this.name = 'CustomError';
}
}

try {
throw new CustomError('Something went wrong');
} catch (e) {
console.log(e instanceof Error);
console.log(e instanceof CustomError);
console.log(e.constructor.name);
console.log(e.name);
}