@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

Made with Slides.com