4 ms·
I thought regex was overkill for that one and used: return input.split(".")[1] || "";
by tensafefrogs 13y ago
I thought regex was overkill for that one and used:
return input.split(".")[1] || "";
- dclowd9901 13y agoI 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.
- Bahamut 13y agoWhat 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.