Lambdas check the number of arguments, while procs do not
Lambdas and procs treat the ‘return’ keyword differently
COMMONS
lambda is a object of a Proc class
Method Object
class Array
def iterate!(code)
self.each_with_index do |n, i|
self[i] = code.call(n)
end
end
end
def square(n)
n ** 2
end
array = [1, 2, 3, 4]
array.iterate!(method(:square))