- Lucas' Newsletter
- Posts
- Javascript is At It Again!
Javascript is At It Again!
![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/5813d141-50a2-4263-878b-70edf1989f48/photo-1543966888-7c1dc482a810.jpeg?t=1722263298)
Photo by Paul Esch-Laurent / Unsplash
I can't believe I'm doing this many posts on JavaScript. But here it is:
![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/cd577b1c-d0fb-4fc8-b03f-4213a819d0e8/image-1.png?t=1722263298)
I hope you cry yourself to sleep thinking about this.
![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/b12b0436-ddd6-45d9-9ffc-a9f5d623fda4/image-2.png?t=1722263299)
This is a cryptic one I admit, why would we get such a weird number when we do `a | 0`? It's because JavaScript interprets a to be a SIGNED 32-bit Float number when we do bitwise operations with it.
What about some easier test cases?
![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/99b36796-d16a-46fe-a806-a65cd752b7ec/Screenshot-2023-02-10-at-6.25.03-PM.png?t=1722263299)
What about numbers?
![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/3bee41de-da54-4295-b857-796779a6797f/Screenshot-2023-02-10-at-6.25.22-PM.png?t=1722263299)
I wonder why haven't we given up JavaScript at this point. We should just go back to punched tapes.
![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/f94789e7-9864-4e5b-b1b0-050c04a91f25/image.png?t=1722263301)
The young people today don't know how good programming was back in the day.
😗 Enjoy my writing?
If you read more than 2 of my posts and loved them, we have an honor code, meaning I give you value and you hit that subscribe button.
Forward to a friend and let them know where they can subscribe (hint: it’s here).
Join an Exclusive Tech Friendly Community! Connect with like-minded people who are interested in tech, design, startups, and growing online — apply here.