What is the difference between #== and #equal in Ruby? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the difference between #== and #equal in Ruby?

14th Apr 2019, 4:05 AM
M. SIVANESH
M. SIVANESH - avatar
2 Answers
0
#== means equal to , it is mostly use in comparison for example If a = = 1 then do something. While #= maens assign or declaring a variable, like a = 1 means "a" is one in your program.
14th Apr 2019, 4:06 PM
Jude
Jude - avatar
0
Ya but #equal is different from #=.
15th Apr 2019, 2:10 AM
M. SIVANESH
M. SIVANESH - avatar