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');
2 odpowiedzi
+ 5
vol isn't a string . If you want to call vol function just write vol() inside console.log
+ 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.