r/programminghorror
•
u/Leonnee
•
Jun 12 '25
•
1
Javascript Javascript is filled with horror
2.4k
Upvotes
View all comments
Show parent comment
1
u/No_Pen_3825 Jun 13 '25
My complaint with JS is it doesn’t do anything for you. You can call me whiny I suppose, but I think it should be more helpful. Swift—my language of choice—is Int.random(in: 1…6), JS is Math.floor(Math.random() * 6) + 1; Swift is array.randomElement(), JS is array[Math.floor(Math.random * array.count)]. JS has alright network calls, but I still think Swift’s is better.