js给对象添加属性
obj.prototype = shuxing;
shuxing['属性']=值;
function Person(){}; var person = new Person(); person.name = 'yy'; person.gender = 'girl'; console.log(person.name+','+person.gender);//yy,girl delete person.name;//删除属性 console.log(person.name);//undefined // 变式 function Person(){}; var person = new Person(); person['name'] = 'yy'; person['gender'] = 'girl'; console.log(person.name+','+person.gender);//yy,girl delete person.name;//删除属性 console.log(person.name);//undefined
愿你遍历山河
仍觉人间值得