I'm building a function which gets a variable that includes a mathematic operator, and two random numbers. I want to return the result of the suitable math action, but I'm not sure how the code should be written.
function result(firstnum, secnum, operator) {
return [???];
}