2021年5月3日星期一

"+1" gives me different result than "+ 1" in ruby?

[6] pry(main)> [1,2,3].min +1  => [1]  [7] pry(main)> [1,2,3].min + 1  => 2  

I'm blown away. it must be something to do with the min function i suppose? because max has the same issue but not sum

https://stackoverflow.com/questions/67377431/1-gives-me-different-result-than-1-in-ruby May 04, 2021 at 08:41AM

没有评论:

发表评论