What is the difference between Fixnum
methods .next
and .succ
in Ruby?
It seems it works identically:
1.next
=> 2
1.succ
=> 2
If there is any difference why there is two method which do the same?
They are equivalent. Fixnum#succ
is just an synonym for Fixnum#next
.
They even share the same block in the reference manual.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With