711
Amiright? (lemmy.zip)
submitted 2 years ago by balderdash9@lemmy.zip to c/memes@lemmy.world
you are viewing a single comment's thread
view the rest of the comments
[-] puppy@lemmy.world 8 points 2 years ago

allProgrammingJokes[Math.floor(Math.random() * allProgrammingJokes.length)]

This might throw array index out of bounds errors.

[-] kionay@lemmy.world 9 points 2 years ago

ECMAScript spec says Math.random must be less than 1. I was about to stop there, but a thought occurred to me: could the multiply with a float make a number large enough to floor to a different value for large enough values? 🤔

I imagine it'd have to be a ridiculously large number to amount enough floating point imprecision to matter, if so.

[-] metaStatic@kbin.social 2 points 2 years ago
this post was submitted on 16 Nov 2023
711 points (95.2% liked)

memes

16668 readers
578 users here now

Community rules

1. Be civilNo trolling, bigotry or other insulting / annoying behaviour

2. No politicsThis is non-politics community. For political memes please go to !politicalmemes@lemmy.world

3. No recent repostsCheck for reposts when posting a meme, you can only repost after 1 month

4. No botsNo bots without the express approval of the mods or the admins

5. No Spam/Ads/AI SlopNo advertisements or spam. This is an instance rule and the only way to live. We also consider AI slop to be spam in this community and is subject to removal.

A collection of some classic Lemmy memes for your enjoyment

Sister communities

founded 2 years ago
MODERATORS