499
parseInt(5) (lemmy.ml)
you are viewing a single comment's thread
view the rest of the comments
[-] danda@lemmy.zip 102 points 1 month ago

It's because parseInt is expecting a string, so the decimal gets converted to a string, and 0.0000005.toString() returns 5e-7.

[-] KindaABigDyl@programming.dev 43 points 1 month ago
[-] AnotherPenguin@programming.dev 5 points 1 month ago

More like javascript L, even python would throw a TypeError for this example.

load more comments (4 replies)
this post was submitted on 05 May 2025
499 points (98.8% liked)

Programmer Humor

24650 readers
1101 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS