const a = { x: 1 };
a.__proto__.x = 2;
const b {};
console.log(a.x, b.x);
Ответ:
JavaScript test | #JavaScript
Please open Telegram to view this post
VIEW IN TELEGRAM
class CustomError extends Error {
constructor(message) {
super(message);
this.name = 'CustomError';
}
}
try {
try {
throw new CustomError('inner error');
} catch (e) {
console.log(e.name);
throw new Error('outer error');
}
} catch (e) {
console.log(e.message);
console.log(e instanceof CustomError);
}
Ответ:
JavaScript test | #JavaScript
Please open Telegram to view this post
VIEW IN TELEGRAM