- What is an expression?
- a fragment of code that produces value
- What is a binding?
- Catches and holds values. Let is the special keyword indicating the sentence is going to define a binding. (Value grasping tenticles)
- What is an environment?
- A collection of bindings and their values that exist at a given time.
- What is a function?
- A piece of program wrapped in value. Such values can be applied in order to run the wrapped program.
- Give an example of a function.
- prompt(“Enter passcode”);
- What is a side effect?
- A change in the internal state of the machine in a way that will effect the statements that come after it. Showing a dialog box or writing text to the screen.
- Give an example of a function that produces a side effect and another function that produces a value.
- (Function Value e.g.)
Console.log(Math.max(2,4);
// --> 4
(Side-effect e.g.)
var count = 0;
function increaseCount(val){
count += val;
}
- What is control flow?
- Statements executed like a story from top to bottom. ---------->
- What is conditional execution?
- Not a straight road, a branching road where programs take branches based on situations at hand.
- What kind of keyword do you need to use to invoke conditional execution?
- The if keyword