摘要:
/*Prototypal Inheritance*/function object(o) { function F() { } F.prototype = o; return new F();}// object to inherit fromvar parent = { name: "Papa"};// the new objectvar child = object(parent);// testingalert(child.name); // "Papa"//used in functionfunction Person() { // an &qu 阅读全文
posted @ 2011-12-17 21:07 ritazhou 阅读(331) 评论(0) 推荐(0) 编辑