cara menangkap dan melempar kesalahan js
try {
throw new Error('Whoops!')
} catch (e) {
console.error(e.name + ': ' + e.message)
}
Relieved Ratel
try {
throw new Error('Whoops!')
} catch (e) {
console.error(e.name + ': ' + e.message)
}