Just a simple JavaScript math library that creates random math examples of addition, subtraction, multiplication and division with fake answers and true ones.
const Randomath = require('randomath');
const math = new Randomath();
[
{
example: '48 + 39',
answers: [ 91, 87, 90 ],
answer: 87,
answerId: 1
}
]
Default number of examples is one. You can change it by replacing times to the number of repeats you need.
For example getRandomAdd(3)
will return 3 addition examples.
Each method returns an array of objects.