I'm Calin Baenen – AKA KattyTheEnby – a programmer born October 30th, 2006.
I love programming, it has been my passion since I was a kid, and will forever be my passion.
The operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones). Numbers with more than 32 bits get their most significant bits discarded.
Instead of
parseIntWorks - and shorter
dev-to-uploads.s3.amazonaws.com/i/...
:)
The hell did I just read?
Bitwise NOT (~):
Unsigned right shift (>>>):
Know the limitations of your tools.
Integers and shift operators in JavaScript
I know all that, but for the purposes of a simple string -> integer parser, this works just fine
that works, but unreadable, therefore it's a bad practice, should be ['1', '2', '10'].map(n => Number.parseInt(n));