![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Object
江醉鱼
神游全世界,苟活人世间
展开
-
对象方法、类方法和原型方法
function People(name){this.name=name;//对象方法this.Introduce=function(){alert("My name is "+this.name);}}//类方法People.Run=function(){alert(“I can run”);}//原型方法People.prototype.IntroduceChinese...原创 2019-06-24 11:10:24 · 558 阅读 · 0 评论 -
Object对象常用方法
Object.entries()方法返回一个给定对象自身可枚举属性的键值对数组,其排列与使用 for…in 循环遍历该对象时返回的顺序一致(区别在于 for-in 循环还会枚举原型链中的属性)。const object3 = { a: 'somestring', b: 42};console.log(Object.entries(object3));//[[a: 'somestri...原创 2020-04-29 14:13:04 · 273 阅读 · 0 评论 -
js之get、set详解
了解之前先看代码,看完之后保证神清气爽,瞬间融汇贯通,上代码!const obj = { log: ['a', 'b', 'c'], get latest() { console.log("this is get function") }, quit: function(){ console.log("this is quit function") }};console.log(obj.latest);//this is get functionconsole.原创 2020-06-15 18:09:01 · 5315 阅读 · 1 评论