try {
const json = '{ nome: "Bruno", "dataNascimento": "09061993" }'
const user = JSON.parse(json)
console.log(user.nome)
} catch (e) {
console.log(e.message) // Unexpected token n in JSON at position 2
}
finally{
console.log('finally'); // Também será executado
}
if (typeof valor !== 'number') {
throw 'O valor precisa ser um número';
}
throw new Error('New error message', { cause: err });