-
What is an expression?
An Expression is a fragment of code that produces a value. -
What is a binding?
A binding allows JavaScript to catch and hold values. It is enabled by using the keyword “let” followed by the name of the binding which is connected to an expression (which yields a value as expressions do) using the = operator.
Eg
Let me = “Kiwan”;
console.log(me);
//Kiwan
-
What is an environment?
The environment is the collection of bindings and their values that exist at a given point in time. Environments are not empty when a program starts up and may contain mission critical bindings that facilitate the language standard and user interface hardware peripherals like reading mouse and keyboard inputs. -
What is a function?
A function is code or part of a program than is represented by a value. -
Give an example of a function.
console.log() ,outputs a value to the console -
What is a side effect?
A side effect occurs when a function shows a dialog box or writes to the screen. -
Give an example of a function that produces a side effect and another function that produces a value.
alert("Hello") /* is a function that produces a side effect
in the form of a text box that says Hello*/
function difference(x, y) { return x-y}; /* defines the
name of the function as "difference"*/
difference(50, 40); /* invokes the function by
substituting values for x and y which returns 10.*/
-
What is control flow?
Statements within a program are executed from top to bottom. Certain statements may be skipped or carried out depending on if conditions set above it are met or not. The resulting sequence of statements being executed is the control flow. -
What is conditional execution?
Execution of code only if certain conditions are met. -
What kind of keyword do you need to use to invoke conditional execution?
The keyword if