Function that check if two algebraic expressions are equal in javascript
问题 var Answer = '2a + 5b' // downloaded from database var input = '5*b+ 2*a' // user input after calculating some algebraic expression. if (Answer == input){ // tell student he solved the math problem correctly. } I want a function so that the above if-statement return true. My problem is that my answer and user input is a string, and when compared they are not equal. The user however have solved the initial problem correct. 回答1: Even though certain forms of algebraic expressions -such as low