Hacker News new | ask | show | jobs
by Arnavion 3735 days ago
TIL 1 is a capital letter.
1 comments

string[0] === string[0].toUpperCase() && string[0].toUpperCase() != string[0].toLowerCase();
typeof string == "string" && string.length && string[0] == string[0].toUpperCase() && string[0].toUpperCase() != string[0].toLowerCase();
Man, Javascript is AWESOME.
/\p{Lt}/.test(str) would be much more compact, but Unicode properties still aren't available in Javascript regular expressions. It doesn't look like they will be anytime soon. I guess they have some staging system and it's still at stage 0 (https://github.com/tc39/ecma262/blob/master/stage0.md), grouped with lookbehind assertions, named captures, and mode modifiers.