Describe the bug
Any attempt to perform subtraction operations fails:
3 - 5 (with spaces around the minus operator) causes an infinite loop resulting in RangeError: Invalid array length.
3-5 or 3 -5 (without space after minus) gets parsed incorrectly as a negative number token ["3", "-5"] and throws Error: Unknown: ["3","-5"].
Steps to Reproduce
Run the calculator and input the following expressions:
echo "3 - 5" | node calculator.js # Causes RangeError: Invalid array length (infinite loop)
echo "3-5" | node calculator.js # Causes Error: Unknown: ["3","-5"]
Describe the bug
Any attempt to perform subtraction operations fails:
3 - 5(with spaces around the minus operator) causes an infinite loop resulting inRangeError: Invalid array length.3-5or3 -5(without space after minus) gets parsed incorrectly as a negative number token["3", "-5"]and throwsError: Unknown: ["3","-5"].Steps to Reproduce
Run the calculator and input the following expressions: