06 2018 档案
摘要:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>break和continue、return的区别</title></head><body><script> // 在 javascript中break,contin
阅读全文
摘要:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>对象的枚举属性</title></head><body><script> // 用来枚举属性的对象工具函数 /*把p中的可枚举属性复制到o中,并返回o, 如果p和o
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>JSON.stringify(), JSON.parse(),toJSON()方法使用</title> </head> <body> <script> /* J
阅读全文
摘要:// 通过原型继承创建一个新对象 function inherit(p){ if (p == null) throw TypeError();//p是一个对象,但不能是null if(Object.create) //如果object.create()存在 return Object.create(
阅读全文
摘要:// 使用 for in 循环遍历对象的属性时,原型链上的所有属性都将被访问: Object.prototype.bar = 10;// 修改Object.prototype var obj = {x:1,y:2,z:3}; var keys = [],values = [],i=0; for(i
阅读全文
摘要:1,obj[key] 2.eval('obj.'+key) 例如: var obj = {x:1,y:2,z:3}; var a = [],i=0; for(i in o){ console.log(i); a.push(i);console.log(obj[i]);//遍历对象属性值的方法 1 2
阅读全文

浙公网安备 33010602011771号