-
对象相关运算符:this,typeof,instanceof,new,delete,void,in,.,[]查看全部
-
Object.defineProperty(<object>,'<property_name>',{[<attribute>:<attribute_value>]*})设置对象属性<property>的特性<attribute>。 <attribute>: 1、[[configurable]]:可配置,true表示允许删除、添加、修改属性等操作; 2、[[writable]]:可写,true表示允许添加和修改属性; 3、[[enumerable]]:可枚举,true表示允许使用for-in等方法来枚举; 4、[[value]]:属性值,默认为undefined,会根据对象定义而定。查看全部
-
算术操作符 比较操作符 逻辑操作符 "="赋值符号查看全部
-
void运算符 把后面的值变成 undefined查看全部
-
this运算符 指定网页上下文的本身查看全部
-
运算符 new hasOwnProperty判断 是自己里面的 还是原型链上的值。查看全部
-
instanceof 判断的是对象的类型 是根据原型链判断的 typeof 判断的是字符串 是否是原始类型 函数对象查看全部
-
in运算符查看全部
-
IE9之后 使用 defineProperty的方法 注意,要configurable 值为true 才能删除。查看全部
-
delete 删除运算符查看全部
-
逗号运算符 取逗号最后的那个值。查看全部
-
条件运算符 ?问号前面是问题 是否为真 真取冒号前面的值,假取冒号后面的值查看全部
-
按照运算符的操作数量来分 有三种 1元就是 +强制转换成数字 — 负数 按照运算符的功能区分查看全部
-
懒人看过来!!!!!!!!!!!!!!!!!!!!! function Person(name,age) { this.name = name; this.age = age; } Person.prototype.hi = function () { console.log("hi,my name is "+this.name+"I'm"+this.age+"years old now."); } Person.prototype.LEG_NUM = 2; Person.prototype.ARMS_NUM = 2; Person.prototype.walk = function () { console.log(this.name+"is walking"); } function Student(name,age,className) { Person.call(this,name,age); this.className = className; } Student.prototype = Object.create(Person.prototype); Student.prototype.constructor = Student; Student.prototype.hi = function () { console.log("Hi,my name is"+this.name+",I'm"+this.age +"years old now,and from"+this.className); } Student.prototype.learn = function (subject) { console.log(this.name + "is learning" +subject+"at" +this.className) } //test var bosn = new Student('Bosn',23,'Class 3,Grade 2'); bosn.hi(); bosn.LEG_NUM; bosn.walk(); bosn.learn('math');查看全部
-
7.对象创建表达式查看全部
举报
0/150
提交
取消