- An expression is code that produces values.
- Binding is used to catch and hold values so they don’t dissipate
- An environment contains the values that have already been binded
- A function is a piece of program wrapped in a value
- An example of a function is Math.min(4,7) = 4
- A side effect is when a function creates a change in the world such as a change in the display or internally in the computer.
- prompt(“enter password”) and Math.max(12,6) = 12
- Control flow is when your program consists of more than one statement
- Conditional statements consist of if else statements and only executes more of code if certain condition is fulfilled.
-
Expression: A fragment of code that produces a single value (string, number, or logical value).
-
Binding: Attaching a value to a chosen identifier within an environment. That identifier can be used to summon the value it’s tethered too.
-
Environment: A collection of Bindings and their values that exist at any given time.
-
Function: A piece of program wrapped in a value. A set of statements that performs a task or calculates a value.
-
Number(prompt(“Pick a number”));
-
Side effect: Any change that is observable outside the called function other than its return value such as displaying a dialog box or writing text to the screen.
-
Example of with and without side effect:
alert(“alerting the user with a dialog box is an example of a side effect”);
let a = 1, let b = 2; console.log(a+b); produces the value 3 -
Control flow is the order in which computers execute statements in a script. eg/in a straight line or branching .
-
Conditional execution is a branching control flow where a particular branch is taken based on the situation at hand.
-
Conditional execution is created using the “If” keyword.
-
Any piece of code that produces a value.
-
It’s a method used in JS to hold onto values inside the internal state (for later use).
-
The environment is a set of bindings and their values that exist at a specific point in time.
-
A function is a piece of program wrapped in a value. Parentheses are usually the wrappers of values, thus making them into functions.
-
alert("Hello World");
-
A side effect is a change in the internal state of a machine that is caused by an expression and has an impact on subsequent statements.
-
prompt("Enter name")
causes a side effect
console.log(12/2)
causes a value to appear. -
When you have more than one statement in your programme, the statements are executed in order, from top to bottom. This is the control flow.
-
Conditional execution is when there is a sort of fork within the control flow, which can lead to a different outcome if the first condition is not met.
-
Keywords needed are:
if, else
- An expression is a fragment of code that produces a value.
- A binding, also known as variable is a way to catch and hold values.
- An environment is the collection of bindings and their values that exist at a given time.
- A function is a piece of program wrapped in a value.
- An example of a function is: prompt (“enter passcode”);
- A side effect is the showing of a dialog box or writing text to the screen.
- An example of a function that produces a value is the console.log (Math.min(2,4)); Its output is 4. A lot of functions are useful because they have the ability to produce side effects.
- Control flow is when your program contains more than one statement and the statements are executed as if they’re a story, from top to bottom (one after the other).
- Conditional execution is when programs aren’t straight and there’s a branching road created, which is where a program takes the proper branch based on the situation at hand.
- The kind of keyword that’s needed to invoke a conditional execution is “if” or “else”
-
What is an expression?
A fragment of code that produces a value, or a literally written value is called an expression -
What is a binding?
A binding catches and holds a value -
What is an environment?
The collection of bindings and their values that exist at a given time is called the environment -
What is a function?
A function is a piece of program wrapped in a value. The value can be applied to run the wrapped program. -
Give an example of a function.
Console.log or prompt or Math.max -
What is a side effect?
Showing a dialog box or writing text to the screen is a side effect. -
Give an example of a function that produces a side effect and another function that produces a value.
Prompt produces a side effect as it shows a dialog box.
Math.max returns a value. -
What is control flow?
The control flow is the way how multiple statements in a program are executed: from top to bottom. -
What is conditional execution?
If the program is not following a straight line but has bifurcations -
What kind of keyword do you need to use to invoke conditional execution?
if
- What is an expression?
A fregment of code that produces a value.
2, What is a binding?
linking a specific word to a value.
-
What is an environment?
The collection of bindings and their values that exist at a given time. -
What is a function?
A piece of program wrapped in a value. Allows for easier repetition. -
Give an example of a function.
Prompt (“enter text”) -
What is a side effect?
Observable unintended changes. When something is modified outside it’s intended function/design. -
Give an example of a function that produces a side effect and another function that produces a value.
console.log()
Math.max() -
What is control flow?
The order in which statements are executed in a program, ordinarily from top to bottom. -
What is conditional execution?
When the code only executes if a condition is met.
10.What kind of keyword do you need to use to invoke conditional execution?
If.
1- A fragment of code that produces a value and every value that is written.
2- A thing to catch and hold values.
3- The collection of bindings and their values that exist at a given time.
4- A function is a piece of program wrapped in a value.
5- In a browser environment, the binding prompt holds a function that shows a little dialog box asking for user input.
6-The result of a statement that affect the world, the state of the machine or the next statement.
7- side affect= ( prompt(“Enter passcode”); )
value= ( (console.log(Math.max(2,4); )
8- Control flow is how your computer runs code from top to bottom. It starts from the first line and ends at the last line, unless it hits any statement that changes the control flow of the program such as loops, conditionals, or functions.
9- Not all programs are straight lines. Conditional execution is created with the keyword “if” and it decides on which way it will go according to the chosen conditions.
10- Conditional execution is created with the if keyword in JavaScript. You can also use the else keyword, together with if, to create two separate, alternative execution paths.
- An expression is code that produces a value
- A Binding is an establishment of a connection between two values. If let a=2+2 then the connection between a and the result 4 is the binding
- Environment is all the bindings and their values
- Function is a piece of program wrapped in a value
- Example of function function add(a,b){return a+b}
- Side effect could be showing a dialog box or having some other interaction with the outside world beside returning a value
- COnsole.log and alert produces side effects, and Math.max produces a value
- Control flow defines the order in which the program statement are executed
- With Conditional execution certain parts of the code are only executed if a certain condition is fulfilled.
- Keywords used to invoke conditional execution is if, else if and else
- What is an expression?
- A fragment of code that produces a value.
-
What is a binding?
Binding means recording or reference a variable in a specificEnvironment Record
. EachEnvironment Record
is related to a specificExecution Context
/variable - and that binds the variable or function name to thethis
keyword for that execution context. -
What is an environment?
The collection of bindings and their values that exist at a given time. -
What is a function?
An amount of values provided in the default environment, i.e. a piece of program wrapped in a value. Such values can be applied in order to run the wrapped program. -
Give an example of a function.
- Prompt(“Enter passcode”) ;
We use parentheses after expression that produces a function value, directly using the name of the binding that holds the function. The value between the parentheses are given to the program inside the function. As above, the prompt function uses the string that
we give it as the text to show in the dialog box. Values given to functions are
called arguments.
-
What is a side effect?
Any application state change that is observable outside the called function other than its return value. -
Give an example of a function that produces a side effect and another function that produces a value.
alert(“alert is a function that produces a side effect”)
console.log(2+4); produces a value -
What is control flow?
It is how computers runs code from top to bottom. It starts from the first line and ends at the last line, unless it hits any statement that changes the control flow of the program such as loops, conditionals, or functions. -
What is conditional execution?
Conditional execution is created with the if keyword in JavaScript. In the simple case, we want code to be executed if, and only, if a certain condition is true. This is where conditional statements comes in and controls a program behaviour and determine whether or not pieces of code can run. -
What kind of keyword do you need to use to invoke conditional execution?
There are multiple different types of conditionals in JavaScript including:
- “If” statements: where if a condition is true it is used to specify execution for a block of code.
- “Else” statements: where if the same condition is false it specifies the execution for a block of code.
- “Else if” statements: this specifies a new test if the first condition is false.
- a fragment of code that produces a value
- It catches and hold values, they do not contain values; they grasp values.
- the collection of bindings and values that that exist in the program
- a function is a piece of program wrapped in a value
- console.log() or prompt() or login
- it could display something on the screen-that counts as changing the world-or it could change the internal state of the machine in a way that will affect he statements that come after it…(showing a dialog box or writing text to the screen is a same effect.)
- control flow is the way program is executed. JavaScript control flow is top to bottom like reading normally.
- the order in which the code is executed.
- where a program takes the proper branch based on the situation at hand. It’s created with “IF” keyword in JavaScript.
- we use the keywords “IF” and “ELSE”
1: An expression is a fragment of code that produces a value, in a language based interface it is considered part of a programming sentence.
2: A binding allows Javascript to catch & hold values, it’s basically how it remembers specific information & allows reference to them in the future.
3: An environment is the collection of bindings and their subsequent values that exist at a given time. An environment will also contain language standard bindings & necessary bindings to allow certain interactions within the surrounding system.
4: A function is a piece of program which is attached to a value.
5:
prompt(“Enter your name to continue”);
6: A side effect is a change within the Javascript world which has an effect visually or internally that effects all statements which come after it.
7:
let name = “Peter”;
8: Control flow is the executed path that the program takes (Generally from top to bottom, however this can vary dependent on the program).
9: Condition execution allows for the program takes different branches of the program’s path based upon the situation at hand.
10: Keyword statements such as ‘IF’, ‘ELSE’ or ‘ELSE IF’.
- An expression is a fragment of code that produces a value
- A binding is used in JavaScript to catch and hold a value
- An environment is a collection of bindings and their values at a given time
- A function is a piece of program wrapped in a value
- The prompt function
- side effects are produced by functions like writing a text to the screen
- prompt(“Text”) produces a side effect, Math.max produces a value
- It is a one way function depending on the values executed, when a program contains more than one statement they are executed from top to bottom, so the output is produced from one straight direction could be from a Boolean value for example
- Conditional execution is when a code is executed if, and only if, a certain condition holds
- You need the if function to invoke conditional exection
- An expression is any valid set of literals, variables, operators, and expressions that evaluates to a single value. The value may be a number, a string, or a logical value. Conceptually, there are two types of expressions: those that assign a value to a variable, and those that simply have a value
- bindings are like tentacles, they dont hold any information but they grasp them, to bindings can point to the same value
- the collection of bindings and their values that exist at a given time is called environment
- A function is a wrapped section that performs a specific task
- alert(“Im rich and handsome”)
- A side effect is any application state change that is observable outside the called function other than its return value. Side effects include: Modifying any external variable or object property (e.g., a global variable, or a variable in the parent function scope chain)
- let num = 0;
const func = () => {
num = 1;
return true;
}
func(); - Control flow is the order in which we code and have our statements evaluated
9.conditional execution means that a condition is only executed when it meets predefined condition - if, if else, while, loop, true/false
[/quote]
- An expression is any valid set of literals, variables, operators, and expressions that evaluates to a single value. The value may be a number, a string, or a logical value. Conceptually, there are two types of expressions: those that assign a value to a variable, and those that simply have a value
- bindings are like tentacles, they dont hold any information but they grasp them, to bindings can point to the same value
- the collection of bindings and their values that exist at a given time is called environment
- A function is a wrapped section that performs a specific task
- alert(“Im rich and handsome”)
- A side effect is any application state change that is observable outside the called function other than its return value. Side effects include: Modifying any external variable or object property (e.g., a global variable, or a variable in the parent function scope chain)
- let num = 0;
const func = () => {
num = 1;
return true;
}
func(); - Control flow is the order in which we code and have our statements evaluated
9.conditional execution means that a condition is only executed when it meets predefined condition - if, if else, while, loop, true/false
- ) An expression is a piece of code that produces a value
2.) Binding is using a keyword such as " let " to attach it to a value
3.) A environment is the present group of binding and values it is attached to at the given time
4.) A function is a piece of program wrapped in value such as “alert, and prompt”
5.) Prompt (“whats your favorite movie”);
6.) A side effect is a function that alters the state of the world it shows a display on the screen or can change the internal state of the machine in a way that will affect statements that come after it
7.) alert (“I am here”); would be a side effect since it alters the state of the world by having a alert pop up and console.log(20+9) produces a value
8.)The order which code is executed top to bottom
9.)When a program uses the situation at hand to respond to what its given, possibly given it another outcome
10.) if, else, else if
-
What is an expression?
A fragment of code that produces a value. -
What is a binding?
A variable - an instruction to “point” to a value or expression -
What is an environment?
The collection of bindings and their values at a given time. -
What is a function?
A piece of program wrapped in a value. The value can be applied in order to run the wrapped program. -
Give an example of a function.
alert(“hey hey”) -
What is a side effect?
A statement that “changes the world”, such as creating an alert box or creating a change in the internal state of the machine that will affect the statements that come after it. -
Give an example of a function that produces a side effect and another function that produces a value.
prompt(“yo”);
Math.max(2,4,5) -
What is control flow?
The order in which statements are executed in a program. -
What is conditional execution?
A “branching” control flow in which the program takes the proper branch based on the situation at hand. -
What kind of keyword do you need to use to invoke conditional execution?
If
Else
-
What is an expression?
An expression is a fragment of code that produces a value. -
What is a binding?
A binding is another word for a variable. It allows a program to store a value for later use. -
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. -
Give an example of a function.
console.log(3+2); -
What is a side effect?
A side effect is a product of a function. -
Give an example of a function that produces a side effect and another function that produces a value.
For example, the side effect of the function prompt(“Enter passcode”); is a dialog box asking the user to enter their passcode. An example of a function that produces a value is console.log(Math.max(2, 4));. The value returned is 4. -
What is control flow?
Control flow determines the order in which statements are executed, which is usually from top to bottom. -
What is conditional execution?
In cases where a program has multiple branches, the program executes a certain branch based on the situation at hand. -
What kind of keyword do you need to use to invoke conditional execution?
To invoke conditional execution, use the words “if” and “else”.
- What is an expression?
- Every written value or operator that produces a value.
- What is a binding?
- Its like nametagging an expression for later use.
- What is an environment?
- It the actual program. The collection of bindings and their values at a given time.
- What is a function?
- A wrapped in program within the code itself. Can be called with parentheses after the expression that produces it.
- Give an example of a function.
- prompt, console.log, alert, math.max
- What is a side effect?
- When a function does more than just get a value. it also shows it, or uses it somehow.
- Give an example of a function that produces a side effect and another function that produces a value.
- Side effect = Alert and no side effect = math.min
- What is control flow?
- The way (direction) the statements is executet in.
- What is conditional execution?
- when the code is executed in different branches based on different conditions.
- What kind of keyword do you need to use to invoke conditional execution?
- the word “if”
-
An expression is a fragment of a code that produces a value. An expression between parentheses is also an expression as is a binary operator applied to two expressions or a unary operator applied as to one.
-
Binding is created by a previous statement and it is called caught and uses it to grab hold of the number produced by number functions. The special (keyword) ‘let’ indicates that a sentence is going to define a binding.
-
An environment is the collection of bindings and their values that exist at a given time
-
A function is a piece of program wrapped in a value. Such values can be applied in order to run the wrapped program.
-
In a browser environment, the binding prompt holds a function that shows a little dialog box asking for the user input.It is used like this: prompt (“Enter passcode”);
-
A side effect is showing a dialog box or writing text to the screen.
-
The function Math.max takes any number of arguments and gives back the greatest.
-
Control Flow are programs containing more than one statement, the statements are executed as if they are a story from top to bottom.
-
Conditional Execution are non straight road programs. It occurs when the programs take a proper branch based on the situation at hand.
- What is an expression?
A fragment of code that produces a value. - What is a binding?
A binding allows you to catch and hold value. - What is an environment?
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. - Give an example of a function.
The binding ‘prompt’ that shows a little dialog box. - What is a side effect?
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.
The function Math.max - What is control flow?
Control flow are programs containing more than one statement. - What is conditional execution?
It is the description of a programs that takes a non-linear road and are executed as they are a stor from top to bottom. - What kind of keyword do you need to use to invoke conditional execution?
If keyword in Javascript.
- is a part of a program that produces the value
- is an any word but you can’t put a number before it only after and no other special symbols are allowed apart from $ and _
- Environment - is all the values and bindings of the code at a time
4.small program surrounded by the value - prompt(“enter your credit card number”); alert(“hello world”)
- side effect is if the functions shows a dialog box alert etc
- alert(“something”) - produces side effect
console.log(Math.max(3,4,5)); - produces value - When the program runs it runs from top to bottom
- when the program might take a different route to execute itself depending on the wanted result
- if and else