An expression is a fragment of code that produces a value.
- What is a binding?
A binding is a relationship between a variable and the value of that variable. Used to catch and hold values.
- What is an environment?
An environment is the collection of bindings and their values that exist at a given time.
- What is a function?
A function is a piece of program wrapped in a value, which can be applied in order to run the wrapped program.
- Give an example of a function.
function f(x) { x+1};
- What is a side effect?
Anything that a user would experience as a result of the function, such as presenting a dialogue box or writing text to the screen, or making a noise.
- Give an example of a function that produces a side effect and another function that produces a value.
alert("This text is a side effect");
Math.max(2, 4);
- What is control flow?
Control Flow is the order that a computer executes sections of a program code.
- What is conditional execution?
Different actions are performed based on logical operators that assess whether an input meets a given condition, then executes the results of that conditional statement or moves on if the condition is not met.
- What kind of keyword do you need to use to invoke conditional execution?
if