文档: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Control_flow_and_error_handling#The_finally_block
The finally block contains statements to execute after the try and catch blocks execute but before the statements following the try...catch statement.
总结就是:『finally中的代码』总会执行,无视 try/catch 里面的任何 throw error&return,『finally中的代码』执行时机是先于任何『next/outer的语句』。
文档: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Control_flow_and_error_handling#The_finally_block
总结就是:『
finally中的代码』总会执行,无视try/catch里面的任何throw error&return,『finally中的代码』执行时机是先于任何『next/outer的语句』。