检查属性 var mouse = { "name": "betta", "age": 3, "varieties": "milaoshu" } mouse.hasOwnProperty("name"); // true mouse.hasOwnProperty("sex"); //false 增加属性 定义个对象 dog,然后赋予各种特性,再赋予 color特性,最后遍历所有的属性以及值 var dog={ name:"芒果", type:"会之王", eat:function(){ alert("吃"); } } Object.prototype.