Java question on acceptable code

Hi everyone,

I am working through the Full Stack course. I have a question on one of the code challenges in JS

PROBLEM - Third Chalenge

Could someone tell me if/why one is more acceptable than the other? My code seems to solve the problem but is leaving out the let numString function. It seems unessesary to me

// Create function here const numberDigits = x => { if (x>0 && x < 10){ return `One digit ${x}`; }else if (x>0 && x < 100){ return `Two digits ${x}`; }else{ return `The number is: ${x}`; } } console.log (numberDigits(-1))


// Create function here const numberDigits = x => { let numString = ''; if (x >= 0 && x <= 9){ numString = 'One digit: ' + x; }else if (x >=10 && x <= 99){ numString = 'Two digits: ' + x; }else { numString = 'The number is: ' + x; } return numString; }

Thank you so much for the information in advance!

The difference is that the answer is saving a string to the variable numbering and then doing return numString at the end but you are returning what should be saved to the variable.