-
没有块级作用域查看全部
-
function arraysSimilar(arr1, arr2){ if(!Array.isArray(arr1)||!Array.isArray(arr2)||arr1.length!=arr2.length){return false} var arr3=[];var arr4=[]; for(var i in arr1){ arr3.push(Type(arr1[i])) arr4.push(Type(arr2[i])) } if(arr3.sort().toString()==arr4.sort().toString()){return true} else{return false} } function Type(a){ if(a===null){return 'null'} else if(a instanceof Date){return 'Date'} else if(a===window){return 'window'} else{return (typeof a)} }查看全部
-
http://www.imooc.com/qadetail/165052查看全部
-
This查看全部
-
function oop(){} oop.prototype.need=function(abc){ get:{ console.log(this.a) } set:{ console.log(abc) } }; var obj = new oop(); obj.a = '我是好人';//我是好人 obj.need('23');//23查看全部
-
强化get/set的使用查看全部
-
属性重叠查看全部
-
var person = {}; Object.defineProperties(person,{ girlfriend:{value:'ml',enumerable:true}, college:{value:'ningde',enumerable:true}, salary:{value:88888,enumerable:true,writable:true} }) Object {girlfriend: "ml", college: "ningde", salary: 45000}college: "ningde"girlfriend: "ml"salary: 88888_proto__: Object Object.keys(person) (3) ["girlfriend", "college", "salary"] Object.getOwnPropertyDescriptor(person,'girlfriend'); Object {value: "ml", writable: false, enumerable: true, configurable: false}configurable: falseenumerable: truevalue: "ml"writable: false__proto__: Object person.girlfriend='nobody'; "nobody" person.girlfriend "ml"查看全部
-
js类型检测查看全部
-
5种原始类型一种对象类型查看全部
-
数据类型查看全部
-
里面的catch又抛出异常所以 先执行 里面的inner,然后再执行finally,再抛出执行外面的catch查看全部
-
对象instanceof函数 instanceof用来判断左边对象的原型链上是否有右边这个函数构造器的prototype属性查看全部
-
使用in,无论是对象上的属性还是原型链上的属性都会找到,如果只需要对象上的属性,则用对象.hasOwnProperty('z')查看全部
-
动态修改prototype的属性时,是会影响所有已创建或者新创建的实例的,但是如果修改整个prototype赋值为新的对象的话,对已经创建的实例是不会修改的,但是会影响后续创建的实例查看全部
举报
0/150
提交
取消