博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Object isSealed()方法
阅读量:2505 次
发布时间:2019-05-11

本文共 658 字,大约阅读时间需要 2 分钟。

Accepts an object as argument, and returns true if the object is sealed, false otherwise. Objects are sealed when they are return values of the function.

接受对象作为参数,如果对象是密封的,则返回true ,否则返回false 。 当对象是函数的返回值时,对象将被密封。

Example:

例:

const dog = {}dog.breed = 'Siberian Husky'const myDog = Object.seal(dog)Object.isSealed(dog) //trueObject.isSealed(myDog) //truedog === myDog //true

In the example, both dog and myDog are sealed. The argument passed as argument to is mutated, and can’t be un-sealed. It’s also returned as argument, hence dog === myDog (it’s the same exact object).

在此示例中, dogmyDog都是密封的。 作为实传递给实是可变的,不能被取消密封。 它也作为参数返回,因此dog === myDog (它是相同的对象)。

翻译自:

转载地址:http://rmqgb.baihongyu.com/

你可能感兴趣的文章
HTML5 Web Storage
查看>>
Poco之ftp目录切换与创建
查看>>
C#泛型参数多线程与复杂参数多线程
查看>>
java读取文件内容
查看>>
供应链管理
查看>>
装箱和拆箱
查看>>
hdu1215 正整数唯一分解定理应用
查看>>
[BZOJ 3530] [Sdoi2014] 数数 【AC自动机+DP】
查看>>
JS调试debug
查看>>
JS 中的string.lastIndexOf()
查看>>
潜移默化学会WPF(技巧篇)--TextBox相关(一) - AYUI框架 - 博客园
查看>>
Quartz.Net进阶之七:QuartzNet其他的功能简述
查看>>
消息队列
查看>>
WPF进阶教程 - 使用Decorator自定义带三角形的边框
查看>>
SQLServer之FOREIGN KEY约束
查看>>
redis 系列2 知识点概述
查看>>
图像滤镜艺术---图像滤镜晕影调节算法研究
查看>>
Win8Metro(C#)数字图像处理--2.21二值图像腐蚀
查看>>
MVC5 + EF6 入门完整教程
查看>>
SQL Server如何在变长列上存储索引
查看>>