- Using math.js simplify() Function
Below examples will illustrate the approach:
Using math.js simplify() function: In this function few rules are applied on the expression, you can create your own custom made rules. Basically this function is like lambda function. Where you can make the rules according to your requirements.
Input :simplify("4/6") Output :"2/3"
Input: 15, 20 Output: 3,4