查看“︁JavaScript/set”︁的源代码
来自康健生活
←
JavaScript/set
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 标题文字 == == 创建 == {{leftrightflex|<syntaxhighlight lang="javascript"> new Set(['foo', 1, true, {}, undefined, function (){}]);</syntaxhighlight>|{{consoleout|<pre> Set(6) {'foo', 1, true, {…}, undefined, …} [[Entries]] 0: "foo" value: "foo" 1: 1 value: 1 2: true value: true 3: value: [[Prototype]]: Object 4: undefined value: undefined 5: function (){} size: 6 [[Prototype]]: Set </pre>}}}} == 格式转换 == === set 转 array === {{leftrightflex|<syntaxhighlight lang="javascript"> const _set = new Set([1, 2, 3]); console.log(Array.from(_set));</syntaxhighlight>|{{consoleout|<pre> [ 1, 2, 3 ] </pre>}}}}
此页面嵌入的页面:
模板:Consoleout
(
查看源代码
)
模板:Double-columns
(
查看源代码
)
模板:Double-columns/style.css
(
查看源代码
)
返回
JavaScript/set
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。