r/CodingHelp • • Nov 09 '21

[Ruby] 2 identical code with 2 absolutely different outcome. Can anybody notice the difference and explain the reason? below i separated each output to make it clear

Post image
42 Upvotes

21 comments sorted by

View all comments

33

u/icjeremy Nov 09 '21

line 5: parts[0]

17

u/waitingformsfs2020 Nov 09 '21

wow. i think im blind

2

u/SaylorMan1496 Nov 10 '21

This is the problem with non static typed languages the compiler would have picked up this error if it wasn’t in Ruby