Final answer:
The 'invalid assignment left-hand side' in JavaScript occurs when the left side of an assignment is not a valid target, such as when using an equality operator in place of an assignment operator, assigning to a literal, or reassigning a constant value.
Step-by-step explanation:
The JavaScript exception 'invalid assignment left-hand side' occurs when there is an attempt to assign a value to something that cannot be assigned a value. Generally, this happens in a situation where an assignment operator (=) is used incorrectly, and the left-hand side of the assignment is not a valid target for assignment.
Using an equality operator (== or ===) instead of the assignment operator (=). For example, if (x == 10) { ... } is correct, but x == 10 = y will throw this exception because it looks like an assignment but uses an equality check.
Assigning a value to an inexpressible value like a literal, e.g. 5 = x;, which makes no sense and is incorrect because numbers like 5 cannot have values assigned to them. It should be the other way around x = 5;.
Attempting to alter a non-writable property or a constant variable. For example, const pi = 3.14; then later pi = 4; will trigger this error because the constant pi cannot be reassigned.
This error can usually be fixed by identifying the incorrect use of the assignment operator and correcting it to either use the correct left-hand side expression that can receive a value, or changing the operator to the correct comparison operator.