-
A fragment of code that produces a value is called an expression
-
A method used to catch and hold values is called a binding. It is also referred to as a variable.
-
The collection of bindings and their values that exist at a given time is - environment.
-
A function is a piece of program wrapped in a value. Executing a function is called invoking, calling, or applying it.
-
A JavaScript function is defined with the function keyword, followed by a name , followed by parentheses ()
(ex. prompt(âEnter passcodeâ); )
// Convert Fahrenheit to Celsius
function toCel(F) {
return (5/9) * (F-32);
}
6.A side effect - An expression that changes the internal state with in the program that affects the statements that come after it.
- let num = value(prompt(âPick a numberâ));
if (num < 1) {
console.log(âSmallâ);
} else if (num < 10) {
console.log(âMediumâ);
} else {
console.log(âLargeâ);
} - When your program contains more than one statement, the statements are
executed from top to bottom. - With conditional execution code is executed only if a certain condition is met.
- The IF command is used used to invoke conditional execution.