Let's say I have a number
let x = 890
and I want it to be rounded to 900
and if the number is 820 then it should be rounded to 800.
Let's also assume the input number (x) will always be an integer,
I know that we can solve this by manually checking if it is greater than 50 or not, but is there a simpler solution? preferably by recursion in javascript.