抛出错误捕获错误 抛出错误throw new Error('错误信息') //抛出错误 捕获错误try{ console.log('如果内部代码发生错误将执行catch')}catch{ console.log('抛出错误')}finally{ console.log('无论try和catch是否报错finally都会执行,及时try出错,catch里面有return,finally还是会执行')}