当前位置:网站首页>Object. Defineproperty and reflect Fault tolerance of defineproperty
Object. Defineproperty and reflect Fault tolerance of defineproperty
2022-06-24 21:56:00 【aliven1】
- Object.defineProperty, There is an error , Will block the thread , Fault tolerant processing requires extensive use try…catch
- Reflect.defineProperty, Can pass Reflect.defineProperty The Boolean value of the call result , Handle fault tolerant branches directly
let obj = {
a:1,b:2}
// adopt Object.defineProperty To operate
//#region
/* try { Object.defineProperty(obj,'c',{ get(){ return 3 } }) Object.defineProperty(obj,'c',{ get(){ return 4 } }) } catch (error) { console.log(error) } */
//#endregion
// adopt Reflect.defineProperty To operate
//#region
/* const x1 = Reflect.defineProperty(obj,'c',{ get(){ return 3 } }) console.log(x1) const x2 = Reflect.defineProperty(obj,'c',{ get(){ return 4 } }) if(x2){ console.log(' So and so operation succeeded !') }else{ console.log(' So and so operation failed !') } */
//#endregion
// console.log('@@@')
边栏推荐
- Sslhandshakeexception: no subject alternative names present - sslhandshakeexception: no subject alternative names present
- VSCode无网环境快速迁移开发环境(VIP典藏版)
- 【Camera基础(一)】Camera摄像头工作原理及整机架构
- Application practice | massive data, second level analysis! Flink+doris build a real-time data warehouse scheme
- Based on asp Net development of fixed assets management system source code enterprise fixed assets management system source code
- 【论】Deep learning in the COVID-19 epidemic: A deep model for urban traffic revitalization index
- Multiplexer select
- Shengzhe technology AI intelligent drowning prevention service launched
- Web project deployment
- 基于ASP.NET开发的固定资产管理系统源码 企业固定资产管理系统源码
猜你喜欢
Kubernetes 集群中流量暴露的几种方案
cv2导包时报Could not find a version that satisfies the requirement cv2 (from versions: none)
How to achieve energy conservation and environmental protection of full-color outdoor LED display
降低pip到指定版本(通过PyCharm升级pip,在降低到原来版本)
如何做到全彩户外LED显示屏节能环保
机器学习:线性回归
Guava中这些Map的骚操作,让我的代码量减少了50%
Tdengine can read and write through dataX
[notes of Wu Enda] multivariable linear regression
壹沓科技签约七匹狼,助力「中国男装领导者」数字化转型
随机推荐
如何做到全彩户外LED显示屏节能环保
WMI and PowerShell get TCP connection list
leetcode1863_ 2021-10-14
Li Kou daily question - day 26 -496 Next larger element I
Graduation design of phase 6 of the construction practice camp
队列实现原理和应用
MySQL optimizes query speed
socket done
煮茶论英雄!福建省发改委、市营商办领导一行莅临育润大健康事业部交流指导
PKI notes
Elegant custom ThreadPoolExecutor thread pool
在每个树行中找最大值[分层遍历之一的扩展]
[notes of wuenda] fundamentals of machine learning
ST表+二分
Li Kou daily question - day 25 -496 Next larger element I
权限想要细化到按钮,怎么做?
TCP RTT测量妙计
leetcode1720_2021-10-14
Unity about conversion between local and world coordinates
Excel layout