查看“︁JavaScript/constructor”︁的源代码
来自康健生活
←
JavaScript/constructor
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 引言 == constructor 是一种用于创建和初始化class创建的对象的特殊方法。<ref>constructor-JavaScript|MDN[EB/OL].https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Classes/constructor</ref> <blockquote><pre> constructor([arguments]) { ... }</pre></blockquote> == 判断 == constructor 属性返回对创建此对象的数组函数的引用。 {{Leftrightflex|<syntaxhighlight lang="javascript"> 'ff'.constructor; [1,2].constructor; {'a':'1'}.constructor; new Object.constructor; var a = new Object; a.constructor; </syntaxhighlight>|{{consoleout|<pre> ƒ String() { [native code] } ƒ Array() { [native code] } VM317:1 Uncaught SyntaxError: Unexpected token ':' ƒ anonymous() {} ƒ Object() { [native code] } </pre>}}}} == 兼容版本 == {| class="wikitable sortable" |- ! rowspan=6| pc !! rowspan=6| mobile !! server |- ! {{Vertical header|stp=1|chrome}} ! {{Vertical header|stp=1|Edge}} ! {{Vertical header|stp=1|Firefox}} ! {{Vertical header|stp=1|Internet Explorer}} ! {{Vertical header|stp=1|Opera}} ! {{Vertical header|stp=1|Safari}} ! {{Vertical header|stp=1|Android webview}} ! {{Vertical header|stp=1|Chrome for Android}} ! {{Vertical header|stp=1|Firefox for Android}} ! {{Vertical header|stp=1|Opera for Android}} ! {{Vertical header|stp=1|Safari on iOS}} ! {{Vertical header|stp=1|Samsung Internet}} ! {{Vertical header|stp=1|Node.js}} |- | 49 || 13 || 45 || NO || 36 || 9 || 49 || 49 || 45 || 36 || 9 || 5.0 || 6.0.0 |}
此页面嵌入的页面:
模板:Consoleout
(
查看源代码
)
模板:Double-columns
(
查看源代码
)
模板:Double-columns/style.css
(
查看源代码
)
模板:Transform
(
查看源代码
)
模板:Transform-rotate
(
查看源代码
)
模板:Vertical header
(
查看源代码
)
模板:Writing-mode
(
查看源代码
)
模块:Vertical header
(
查看源代码
)
返回
JavaScript/constructor
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。