<html>
<head>
<script>
class Rectangle{
constructor(width=1,height=1){
this.width=width;
this.height=height;
}
getArea(){
return this.width*this.height;
}
}
var rectangle1=new Rectangle(3,4);
console.log("Alan I : "+rectangle1.getArea());
var rectangle2=new Rectangle();
console.log("Alan II : "+rectangle2.getArea());
</script>
</head>
<body>
<h1> Varsayılan Değer </h1>
</body>
</html>
Dosyayı İndir