0

我想将属性“名称”添加到子对象

  var parent =new Object()
  parent.name="raymond"

  var child=new Object();
  child.prototype=parent;
  child.name //undefined , not work...
4

1 回答 1

0
var child = Object.create(parent);

文档

于 2013-07-02T02:35:32.320 回答