猿问

这一整段都搞不太明白?

<!DOCTYPE html>

<html>

<body>

<script>

function person(firstname,lastname,age,eyecolor)

{

this.firstname=firstname;

this.lastname=lastname;

this.age=age;

this.eyecolor=eyecolor;

 

this.changeName=changeName;

function changeName(name)

{

this.lastname=name;

}

}

myMother=new person("Steve","Jobs",56,"green");

myMother.changeName("Ballmer");

document.write(myMother.lastname);

</script>


</body>

</html>


晴无忧he汤圆
浏览 1181回答 1
1回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答