This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You Don't Know JS: Scope & Closures | |
# Chapter 1: What is Scope? | |
One of the most fundamental paradigms of nearly all programming languages is the ability to store values in variables, and later retrieve or modify those values. In fact, the ability to store values and pull values out of variables is what gives a program *state*. | |
Without such a concept, a program could perform some tasks, but they would be extremely limited and not terribly interesting. | |
But the inclusion of variables into our program begets the most interesting questions we will now address: where do those variables *live*? In other words, where are they stored? And, most importantly, how does our program find them when it needs them? | |
These questions speak to the need for a well-defined set of rules for storing variables in some location, and for finding those variables at a later time. We'll call that set of rules: *Scope*. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Testing | |
* one | |
* two | |
* three |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Multiple Items and Event Monitoring Example | |
import com.hydrotik.queueloader.QueueLoader; | |
import com.hydrotik.queueloader.QueueLoaderEvent; | |
var imageContainer:Sprite = new Sprite(); | |
addChild(imageContainer); | |
imageContainer.x = imageContainer.y = 25; | |
var _oLoader:QueueLoader = new QueueLoader(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'ostruct' | |
# Ruby Gems | |
require 'haml' | |
require 'json' | |
require 'sinatra' unless defined?(Sinatra) | |
require 'bumble' | |
require 'movie' |
NewerOlder