Every expression in Ruby returns a value; in irb
, the value returned by the expression you’ve just executed is displayed after =>
.
The return value of Enumerable::each
is the object that called each
– in this case, the array [1,2,3,4]
More Related Contents:
- How can I access a variable defined in a Ruby file I required in IRB?
- Why isn’t current directory on my Ruby path? [duplicate]
- When monkey patching an instance method, can you call the overridden method from the new implementation?
- Why doesn’t Ruby support i++ or i– (increment/decrement operators)?
- Double vs single quotes
- How do I pick randomly from an array?
- What is the difference between include and extend in Ruby?
- How do I update Ruby Gems from behind a Proxy (ISA-NTLM)
- Ruby: How to post a file via HTTP as multipart/form-data?
- How to make –no-ri –no-rdoc the default for gem install?
- How to check if a value exists in an array in Ruby
- When to use lambda, when to use Proc.new?
- How to match all occurrences of a regex
- How to search file text for a pattern and replace it with a given value
- Ruby function to remove all white spaces?
- Output array to CSV in Ruby
- What does tilde-greater-than (~>) mean in Ruby gem dependencies? [duplicate]
- Generating GUIDs in Ruby
- Mac user and getting WARNING: Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.7.3
- Unexpected keyword_end error, yet syntax seems fine
- Valid email address regular expression? [duplicate]
- list of ruby operators that can be overridden/implemented
- Ruby objects and JSON serialization (without Rails)
- Ruby – Difference between Array#
- ERROR: While executing gem … (Errno::EPERM) Operation not permitted [duplicate]
- ERROR: While executing gem … (Gem::FilePermissionError)
- class
- How can I generate zip file without saving to the disk with Ruby?
- Convert unicode codepoint to string character in Ruby
- Ruby Fibonacci algorithm