当前位置:首页 > 手册大全 > javascript手册 > Array.prototype.toSource()

非标准
该特性是非标准的,请尽量不要在生产环境中使用它!

概述

返回一个字符串,代表该数组的源代码.

语法

array.toSource()

参数

描述

在调试时,你可以使用toSource方法来查看一个数组的内容.

例子

例子: 查看数组的源码

var alpha = new Array("a", "b", "c");

alpha.toSource();   //返回["a", "b", "c"]

浏览器兼容性

Update compatibility data on GitHub
Desktop Mobile Server
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android Safari on iOS Samsung Internet Node.js
Basic support
Non-standard
Chrome No support No Edge No support No Firefox Full support 1 IE No support No Opera No support No Safari No support No WebView Android No support No Chrome Android No support No Edge Mobile No support No Firefox Android Full support 4 Opera Android No support No Safari iOS No support No Samsung Internet Android No support No nodejs No support No

Legend

Full support  
Full support
No support  
No support
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.

相关链接

公益性全栈资源网站,鸣谢默默付出的博主、工程师、架构师们。
网站内容来源技术大牛的辛勤结晶。
81For 技术网站 Copyright ©2019 备案号:津ICP备19001147号-2