After invoking my function, I was startled that my function didn't throw up an error due having a variable & using a variable not define in the function's scope.
My question: Why doesn't my function throw an undefined,error, or the like? Shouldn't it throw up an error because "length" isn't in my function's parameter? I am aware that if I switch "length" to "height" it will work.
If someone could explain how javascript interprets this function in a step-by-step manner that would help me. Here is my code:
function areaRectangle(width, height) {
aRectangle = width * length;
console.log("The area of the rectangle is: " + aRectangle);
}
areaRectangle(10, 7); # The area of the rectangle is: 0