Ruby: symbols vs. strings
Example:
:symbol
Symbols are lightweight, immutable strings.
Solution:
hash = {symbol: "value"}
puts hash[:symbol] // Outputs: value
Example: Solution:Ruby: symbols vs. strings
Symbols are lightweight, immutable strings.
:symbol
hash = {symbol: "value"}
puts hash[:symbol] // Outputs: value