this post was submitted on 01 Oct 2023
476 points (96.7% liked)

Programmer Humor

32464 readers
518 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

The audacity to do such a thing…

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 23 points 1 year ago (1 children)

It would probably be way easier than expected to do so in javascript. It would also be awful.

[–] [email protected] 16 points 1 year ago* (last edited 1 year ago) (1 children)
for(var i=0; i \< numLoops; i++){
    globalThis['example'+i] = doStuff(i);
}
[–] [email protected] 12 points 1 year ago* (last edited 1 year ago) (1 children)
for(var i = 0; i < numLoops; i++) {
    eval("var_" + i + " = " + i + ";");
}
[–] [email protected] 10 points 1 year ago (1 children)

eval is a path to powers many would consider to be... unnatural

[–] [email protected] 2 points 1 year ago (1 children)

Is it possible to learn this power?

[–] [email protected] 5 points 1 year ago