<script>
var Table = {
length: 80,
width: 50,
height: 200,
Area :function () {
var area= this.length*this.width;
var volume=this.length*this.width*this.height;
document.write("面积1:"+area);
document.write('<br>'+"体积1:"+volume+'<br>');
return Area ;
}
}
Table.Area ();
</script>
<script>
var table = {
length: 70,
width: 50,
height: 200,
Area:function () {
var area=this.length*this.width;
var volume= this.length*this.width*this.height;
document.write('<br>'+"面积2:"+area);
document.write('<br>'+"体积2:"+volume+'<br>');
return Area ;
}
}
table.Area ();
</script>
<script>
var table = {
length:60,
width: 50,
height: 200,
Area:function () {
var area=this.length*this.width;
var volume= this.length*this.width*this.height;
document.write('<br>'+"面积3:"+area);
document.write('<br>'+"体积3:"+volume);
return Area;
}
}
table.Area();
</script>