I have a function that uses 3 variables and a try catch. I want to use the 3 variables as part of an array but if i do i cannot complete the try catch and function correctly
JS:
function calculateVolume() {
length = document.getElementById("Length").value;
width = document.getElementById("Width").value;
height = document.getElementById("Height").value;
try {
if ((length > 1000) || (width > 1000) || (height > 1000))
throw "err"
else
var volume = length * width * height;
alert(volume);
} catch (err) {
alert("You have not entered all three dimensions correctly");
}
}