r/programminghorror • • Sep 25 '26

Javascript Rock paper scissors

Post image

I'm way too proud of this solution haha

288 Upvotes

27 comments sorted by

View all comments

Show parent comment

5

u/Kwolf21 [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Sep 26 '26

That's Javascript for ya. Very little rules. 1 + "1" = 11 :)

1

u/gsweats Sep 28 '26

JavaScript was created in a rush and by a newer programmer. Really to bad they didn't see the problem with using + for both addition and concatenation.