window.addEventListener('unhandledrejection',function(event){
// the event object has two special properties:alert(event.promise);// [object Promise] - the promise that generated the er
捕获错误方式rejectedcatch全局捕获示例:unhandledrejectionwindow.addEventListener('unhandledrejection', function(event) { // the event object has two special properties: alert(event.promise); // [object Promise] - the promise that generated the error alert(e