/**
* 父对象
*/
function Father(name)
{
console.log(name)
}
/**
* 使用Call方法
*/
function Boy()
{
Father.call(this,'boy')
}
new Boy()
/**
* 使用Apply方法
*/
function Girl()
{
Father.apply(this,['girl'])
}
new Girl()
网友评论