1. What is an expression?
An expression is a fragment of code that produces a value.
2. What is a binding?
Binding is that can hold values in JS.
3. What is an environment?
An environment is the collection of bindings and their values that exist at a given time.
4. What is a function?
Function is a piece of program wrapped in a value.
5. Give an example of a function.
promt(“Enter a number”);
When prompt is the function that print a text box on screen and request for a value.
Enter a number is the argument of the function.
6. What is a side effect?
A side effect is a change made by a statement in JS. It can be displaying something on screen or changing the internal state of the machine.
7. Give an example of a function that produces a side effect and another function that produces a value.
1 - alert(“Hello world”) is a function producing a side effect.
2 - Math.max(3,2); is a function producing a value. In this case, the value is 3
8. What is control flow?
It is the order in executing the function in a program.
9. What is conditional execution?
Conditional execution is the process that may takes more than one path from the input to the output.
10. What kind of keyword do you need to use to invoke conditional execution?
We use if function to invoke conditional execution.