0

JS problem - Lesson about objects

Hi, can somebody help me with this, please?? What am I doing wrong? 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 volum(x,y,z){ var t = x*y*z return t; } console.log(volum)

30th Sep 2021, 2:57 PM
Marta Vall-llovera
Marta Vall-llovera - avatar
2 Answers
+ 2
It should be: console.log(volum(x,y,z))
30th Sep 2021, 3:02 PM
Eashan Morajkar
Eashan Morajkar - avatar
0
Marta Vall-llovera You haven't given the function arguments
30th Sep 2021, 3:01 PM
Eashan Morajkar
Eashan Morajkar - avatar