close
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script type="text/javascript">
function Person(height,weight){
this.height=height; /*在function裡面定義物件屬性*/
this.weight=weight;
}
var Amy=new Person(160,40);
document.write(Amy.height+' '+Amy.weight);
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script type="text/javascript">
var person=function Person(height,weight){
document.write(height+' '+weight);
}
var Amy =person.bind(null);
Amy(160,40);
</script>
</body>
</html>
全站熱搜
留言列表