Ok so I looked up a bit and it does need an explicit return keyword before the ternary expression, but I didn’t think it needed it since I had known the ternary expression format implies the values between the colon will return either of them (depending if true of false).
Oh, and geez, thanks for those three dots that exuded a bit of passive-aggressiveness as if it’s just a silly mistake that I just forgot the return keyword even though my question is a valid question for a beginner.
the ternary operator returns a value, but using a ternary operator doesn’t imply that the value is also returned from the function, you need to explicity state what value is returned from the function
Thanks for the alternate solution! I think this and the solution using return statement with a ternary operator should also be in the official ‘Get a Hint’ solutions post and include an explanation regarding needing an explicit return keyword.