Why this expression evaluating to 13 ?.
I accidentally evaluated this expression (1_2).next instead of (1+2).next which o/p 4 as result.
=> (1_2).next
=> 13
Please let me know how this is, as i m new to Ruby
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Ruby allows you to use
_to break up long numbers, for examplebut the latter is a little easier to read, so your code is the same as
12.next