K
Kaye Ng
"code blocks may accept none, one, or more parameters"
I understand how ONE parameter is passed using the 'each' method.
I also understand how TWO parameters is passed, like in this code
x = { "a" => 100, "b" => 20 }
x.delete_if { |key, value| value < 25 }
p x
Can anyone give me a very simple and executable code where:
NO parameters is passed, and
THREE parameters is passed
SIMPLE CODE/SYNTAX ONLY PLEASE, BEGINNER HERE. =D
Thanks so much.
I understand how ONE parameter is passed using the 'each' method.
I also understand how TWO parameters is passed, like in this code
x = { "a" => 100, "b" => 20 }
x.delete_if { |key, value| value < 25 }
p x
Can anyone give me a very simple and executable code where:
NO parameters is passed, and
THREE parameters is passed
SIMPLE CODE/SYNTAX ONLY PLEASE, BEGINNER HERE. =D
Thanks so much.