Comment on You Can't JavaScript Under PressureparentComments−tensafefrogs12yI thought regex was overkill for that one and used:return input.split(".")[1] || "";−dclowd990112yI fully anticipated a test case like file.name.ext. Of course, you could still do what you're doing, but it'd be a lot more verbose.−Bahamut12yWhat if it had multiple dots? Anyhow, I am on 5 hours of sleep, and already s spent6 hours coding...I just wanted to finish fast.
Comments
I thought regex was overkill for that one and used:
return input.split(".")[1] || "";
I fully anticipated a test case like file.name.ext. Of course, you could still do what you're doing, but it'd be a lot more verbose.
What if it had multiple dots? Anyhow, I am on 5 hours of sleep, and already s spent6 hours coding...I just wanted to finish fast.