JavaScript 支持情况
运行限制
基于安全考虑,小程序中不支持动态执行 JS 代码,即:
- 不支持使用 eval 执行 JS 代码
- 不支持使用 new Function 创建函数
客户端 ES6 API 支持情况
微信小程序已经支持了绝大部分的 ES6 API,已支持的 API 如下(部分API依赖系统版本):
| String |
iOS8 |
iOS9 |
iOS10+ |
Android |
| codePointAt |
|
|
|
|
| normalize |
|
|
|
|
| includes |
|
|
|
|
| startsWith |
|
|
|
|
| endsWith |
|
|
|
|
| repeat |
|
|
|
|
| String.fromCodePoint |
|
|
|
|
| Array |
iOS8 |
iOS9 |
iOS10+ |
Android |
| copyWithin |
|
|
|
|
| find |
|
|
|
|
| findIndex |
|
|
|
|
| fill |
|
|
|
|
| entries |
|
|
|
|
| keys |
|
|
|
|
| values |
|
|
|
|
| includes |
|
|
|
|
| Array.from |
|
|
|
|
| Array.of |
|
|
|
|
| Number |
iOS8 |
iOS9 |
iOS10+ |
Android |
| isFinite |
|
|
|
|
| isNaN |
|
|
|
|
| parseInt |
|
|
|
|
| parseFloat |
|
|
|
|
| isInteger |
|
|
|
|
| EPSILON |
|
|
|
|
| isSafeInteger |
|
|
|
|
| Math |
iOS8 |
iOS9 |
iOS10+ |
Android |
| trunc |
|
|
|
|
| sign |
|
|
|
|
| cbrt |
|
|
|
|
| clz32 |
|
|
|
|
| imul |
|
|
|
|
| fround |
|
|
|
|
| hypot |
|
|
|
|
| expm1 |
|
|
|
|
| log1p |
|
|
|
|
| log10 |
|
|
|
|
| log2 |
|
|
|
|
| sinh |
|
|
|
|
| cosh |
|
|
|
|
| tanh |
|
|
|
|
| asinh |
|
|
|
|
| acosh |
|
|
|
|
| atanh |
|
|
|
|
| Object |
iOS8 |
iOS9 |
iOS10+ |
Android |
| is |
|
|
|
|
| assign |
|
|
|
|
| getOwnPropertyDescriptor |
|
|
|
|
| keys |
|
|
|
|
| getOwnPropertyNames |
|
|
|
|
| getOwnPropertySymbols |
|
|
|
|
| Other |
iOS8 |
iOS9 |
iOS10+ |
Android |
| Symbol |
|
|
|
|
| Set |
|
|
|
|
| Map |
|
|
|
|
| Proxy |
|
|
|
|
| Reflect |
|
|
|
|
| Promise |
|
|
|
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《微信小程序 JavaScript支持情况》
文章链接:
https://zhuji.vsping.com/310872.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。