小程序iOS Promise不支持finally語法 TypeError: undefined is not a function .finally is not a function

小程序iOS Promise不支持finally語法

一開始知道finally語法是在Java,以爲是很基本的語法,所以在JavaScript應該也支持,不需要考慮兼容性,後來查MDN才發現並不是。

Promise的finally和try…catch…finally不是同一個東西,只是都叫finally而已。

在小程序的iOS中,更是直接不支持Promise的finaly語法,會報TypeError: undefined is not a function.finally is not a function的錯誤,還好,把finaly換成then能解決問題
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章