Closures
YOUR LINK HERE:
http://youtube.com/watch?v=6TBz9ODHchM
Support Avelx: • The new case for gold: http://ir-uk.amazon-adsystem.com/e/ir... • The road to ruin: https://www.amazon.co.uk/gp/product/0... • Closures seem complex but really they are very simple and an amazing language feature. The worlds most popular language Javascript takes center stage with this feature. • Simply put closures are a way of keeping values and not allowing the garbage collector to remove these references or symbols out of memory. • When creating any variable or constant you are creating what is known as a symbol that is stored in the symbols table. This symbol is kept until we no longer need it. In other words, no other part of our script can access this symbol so there's no point keeping it in memory. This is where garbage collection will remove symbols that can no longer be used by our program. • However when creating inner functions, subroutines or execution contexts; their all the same thing, we need to keep a reference to the data outside of that inner function so it can execute later when needed. This'll prevent errors as our program's run.
#############################
