Yeah that condition just evaluates normal math expressions not an expression in a string.
I think any non empty string besides “0” will be true.
To evaluate an expression in a string you have some options:
One way is to write a text parser to extract the operators and numbers and evaluate the expression. That would give you the most control over how it’s done.
A second way is to use the browser objects execjs expression. It’s basically the eval function js has. It can’t reference variables though.
Third option would be to find a plugin that evaluates text expressions. I’m sure someone made one before.