4 ms·
less sexy when you write /^(11+?)\1+$/ is a prime test on whether a unary string > 2 is composite then people have a real chance of figuring it out. (go a
by logicallee 12y ago
less sexy when you write
/^(11+?)\1+$/ is a prime test on whether a unary string > 2 is composite
then people have a real chance of figuring it out. (go ahead and try, if you haven't read the article.)
As it stands that 1 x shift is super confusing. who would have thought 1 would become a literal! we wouldn't even write it that way in english.