@MQuy

Topic: Ruby Block, Lambda & Proc

Closure

Closure is the combination of function and environment

name = 'Hello Closure'

closure = -> { puts name }
closure.call
closure = -> { puts name }

name = 'Hello Closure'
closure.call

Quiz

  1. Using same variable name without changing in closure scope?

Summerize

Block, Lambda & Proc

By Minh Quy

Block, Lambda & Proc

  • 1,040