0
Trying to use object method to calculate volume of a rectangular prism
1 Réponse
+ 4
var cuboid = {
length: 25,
width: 50,
height: 200,
volume: function() {
return this.length * this.width * this.height;
}
//volume: vol(length ,width ,height );
};
console.log(cuboid.volume())
/*console.log(cuboid.length*cuboid.width*cuboid.height) */