"You can change the function by wrapping the returned value in parens and multiply by 1 at the end if you need a number returned rather than a string"
But the function already has a part that freshly generates the raw rounded number: Math.round(num * 10) / 10. Just leaving that part will do; no need to generate a number -> cast to string -> cast to number
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
"You can change the function by wrapping the returned value in parens and multiply by 1 at the end if you need a number returned rather than a string"
But the function already has a part that freshly generates the raw rounded number:
Math.round(num * 10) / 10
. Just leaving that part will do; no need to generate a number -> cast to string -> cast to number