Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
jrawlings
12y ago
0 comments
Share
I just did
return i.indexOf('.') > -1 ? i.substring(i.indexOf('.')+1) : false;
Seemed to pass all test cases
0 comments
default
newest
oldest
EdgarVerona
12y ago
Aye, I did similarly, though for some reason I did >= 0 instead of > -1. I wonder what % of people choose one test approach vs. the other?
taternuts
12y ago
I chose >= 0, it's fun to learn!
j
/
k
navigate · click thread line to collapse