How to use the sort function from mathjs

Find comprehensive JavaScript mathjs.sort code examples handpicked from public code repositorys.

53
54
55
56
57
58
59
60
61
optionsArray.push(numerator);
optionsArray.push(denominator);

question = `Arrange the following in ascending order: <br/>{&#8508;, ${number}, &radic;<span style="text-decoration: overline">${squareroot}</span>, &#8731;<span style="text-decoration: overline">${cuberoot}</span>, <sup>${numerator}</sup>&frasl;<sub>${denominator}</sub>}`;

answer = math.sort([Math.PI, number, Math.sqrt(squareroot), Math.cbrt(cuberoot), numerator/denominator]);

array.push(optionsArray);
array.push(answer);
fork icon0
star icon0
watch icon0