Currying a function with arguments returns a function that calls the original function with the arguments provided. For example, the following function (f1 and f2) are equivalent; to create f2, the sayThing function is curried with the first of its arguments (verb) to create a function with the second argument (noun) as the only argument:
sayThing = function(verb, noun) {
alert( "Why dont you " + verb + " the " + noun + "?")
}
f1 = function (noun) {
sayThing("jump", noun);
};
f2 = sayThing.curry("jump");
The game loop allows the game to run smoothly regardless of a user's input or lack thereof. A game loop will typically do the following:
A hash is simply a Javascript object, with a set of associated keys and values. For example:
var thing = {
key : "Value",
another : [1, 2, 3, 4]
};
In other programming languages, a hash may be referred to as a struct(ure), or a dictionary.