0

Help with this one please. Thank you in advance you kind people out there !

The given class represents a cuboid (e.g. a rectangular prism) that contains the properties of length, width, and height. Complete the program to calculate and output the volume of given cuboid to the console. var cuboid = { length: 25, width: 50, height: 200 }; //your code goes here var x = cuboid.length; var y = cuboid.width; var z = cuboid.height; function vol(x,y,z){ return x*y*z; } console.log('vol');

11th Jul 2021, 1:39 PM
Sanchit Bahl
Sanchit Bahl - avatar
2 Antworten
+ 5
vol isn't a string . If you want to call vol function just write vol() inside console.log
11th Jul 2021, 1:42 PM
Abhay
Abhay - avatar
+ 2
vol is a function. So you need to call the function and pass the argument. and store the result in the variable and log that in the console.
11th Jul 2021, 1:43 PM
Aasim Sayyed
Aasim Sayyed - avatar