Answers

Question and Answer:

  Home  Ruby Developer

⟩ Tell me how Symbol is different from variables?

Symbol is different from variables in following aspects

☛ It is more like a string than variable

☛ In Ruby string is mutable but a Symbol is immutable

☛ Only one copy of the symbol requires to be created

☛ Symbols are often used as the corresponding to enums in Ruby

 168 views

More Questions for you: