Используя этот скрипт, я сталкиваюсь с этой ошибкой Not a number value
, которую я не понимаю,
Как я могу это исправить?
<!DOCTYPE html>
<html>
<head>
<title>The Cube</title>
</head>
<body>
<script>
var cube = function(side) {
this._side = side;
this.volume = function() {
var vol = Math.pow(this.side, 3);
return vol;
};
this.surface = function() {
var totalLength = 12 * this.side;
return totalLength;
};
};
var firstCube = new cube(2);
document.write("Volumul " + firstCube.volume() + "<br>");
document.write("Total length " + firstCube.surface());
</script>
</body>
</html>