im trying to do some Math in a js function while using MathJs & getting this error :Math.evaluate is not a function
<script src=" https://cdnjs.com/libraries/mathjs"></script>
Do-Math :<input id="formula" />
<button onclick="goCalc()">Go</button>
results:<input id="resTxt"/>
<script type="text/javascript">
function goCalc() {
let Mformula = $("#formula").val();//the formula im trying to get =6*4+2^2
var res = document.getElementById("resTxt");
// res.setAttribute("value", Mformula);
var mat = Math.evaluate(Mformula);
res.setAttribute(mat);
console.log(mat);
}