- An expression is a fragment of code which produces a value
- A binding is a variable, to which it is possible to assign values that each binding will refer to when called.
- An environment is the collection of expressions and bindings present at a given time.
- A function is a piece of program embedded within a specific value, which will be executed when it is used.
- Console.log, which is a function used to return values as output.
- An effect produced by functions through which it is possible to show text or dialog boxes.
7.side effect: prompt(âDid you know that this function produces a side effect?â);
value: console.log(3+3); - Is the order which will be followed when performing actions defined by statements, basing on the statement nature and order.
- It is a way to link the execution of tasks to some condition. An example is the âifâ statement, which will determine an action basing on the actual result of some kind of condition.
- The âIfâ statement
- What is an expression? An expression is a fragment of code that is part of a statement.
- What is a binding? A binding is a variable, which allows a program to store and reuse a value and refer to it by name.
- What is an environment? The environment is the bindings currently available and the values associated with the bindings.
- What is a function? A function is a piece of program that is contained by a value.
- Give an example of a function. prompt(âEnter your ageâ);
- What is a side effect? A side effect is something that happens as a result of running a function; in the above function example, a prompt box appears asking for the userâs age.
- Give an example of a function that produces a side effect and another function that produces a value. prompt(âHit OK hardâ);
square(root); - What is control flow? Control flow is the way a program runs, based on protocol: top to bottom; if then else; looping.
- What is conditional execution? Based on the conditional statement, the program either goes one way or another or another. If ConditionA = true, then run amok, [else run straight]. Allows branching of programs depending on the value.
- What kind of keyword do you need to use to invoke conditional execution? IF - ELSE
-
Any code which results in a value is called an expression. There are two types of an expression. The first assign a value to a variable (e. g. x=1) and the second have a simple value (3+4). Values are not only numbers but also strings and so on and so forth.
-
In a binding you declare a variable and assign a value to it (number, string etc.). Now you can use this variable itself as an expression. Anything you want to save and use it at a later time should be binded, so that you could use this variable anytime and could also modify it.
-
Everything (all binding and their values) what is existing at a given time is called the environment. When you start a program and there are already predefined functions etc. this is called the environment because it is not empty.
-
A function is a piece of code which you can call. The function itself works with none, a single or various inputs (many of them are variable). Based on the inputs the functions return something or results in changing variable values or actual operations
-
A function could be the sum of two variables
function sum(number1, number2) {
return number1+number2;
}
-
When a function has an influence on something and leads to a change (and is not just thrown away which mean the changes can be seen, e. g. something is displayed or an internal state is changed which affects the following statements) this is called side effects.
-
prompt(âEnter passcodeâ) shows a little dialog box --> function with a side effect
Math.max(1, 2) --> function without side effect producing a value -
The control flow is the order in which the program is run through. When there is more than one statement and no conditional executions the statements are executed from top to the bottom. This results in a straight-line control flow. But there are conditional executions which change results in not just executing the statements from the top to the bottom and therefore the executing of the statements is different (e. g. jump back to statements, don´t execute a statement)
-
When a program should not just execute the statements from the top to the bottom but should use a branching route, where the program takes the branch which satisfy a certain condition, this is called conditional execution.
-
if, else if and else
- An expression is a fragment of code that produces a value.
- Binding is to catch and hold a value using the special word LET.
- An Environment is a collection of bindings and their values that exist at a given time. When the program starts the environment is empty.
- A function is a piece of program wrapped in a value.
- PROMPT (âEnter Passwordâ); is an example of a function.
- A side effect is when something observable happens to the world.
- The PROMPT function produces a side effect (Dialogue Box) and Math.max is a function that produces a value.
- Control flow is when statements of a program are executed top to bottom.
- Conditional execution is when a program is executed based on the situation at hand.
- To invoke conditional execution use the keyword IF.
- What is an expression?
Fragment of code that produces a value - What is a binding?
A variable that JS uses to catch and hold value - What is an environment?
A 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.
prompt(âinsert nameâ); - What is a side effect?
It is a statement result that changes something that affects the program or later statements. - Give an example of a function that produces a side effect and another function that produces a value.
alert(âpop upâ)
Math.Max(15, 1, 7) - What is control flow?
When program has multiple statements they are executed from top to bottom - What is conditional execution?
If program is not straight forward and has branches, conditional execution ensures that 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
1- an expression is a fragment of code that produces any value.
2- A binding or a variable allows to catch and hold new values, meaning if we change an old value with a binding it will recognize the new value and overwrite the old one.
3- the collection of bindings and their values that exist at a given time is called the environment.
4- A function is a piece of program wrapped in a value.
5- prompt (" day of the week");
alert(âhello worldâ);
6- Showing a digital box or writing text to the screen is a side effect.
7- console.log(a); let a =1;
8- Control flow runs the program from top to bottom this is useful if we have many statements that need to run in a certain order for it to be able to be executed.
9- a conditional execution is when the code is executed only when certain conditions are met. in Javascript we use if.
for example:
var a = 10; var b = 15; if(a<15), console.log(âa+bâ);
10- If and else.
-
an expression is every type of written value
-
a binding is a connection between a variable and a value
-
the environment in a JS program contains all existing bindings inside a program
-
a function is a program where you can insert a value inside parentheses () to run this particular program
-
the function âprompt(âEnter passcodeâ);â will display a window where you can type in a value in this case it wants you to insert your password
-
a side effect can be caused by a statement. If the code inside a statement triggers any visual or technical effects, these effects will be called side effects
-
the function described in â5.â produces a side effect, which is the window asking for a password. A function like console.log(Math.max(2, 4)); does not produce a side effect, it only prints out the biggest number argument written inside of the function to the console.
-
Statements in a program will run in control flow from top to bottom all statements will be executed one after the other.
-
conditional flow is a part in a program where the next statement is chosen by a certain condition If condition a is met, the next statement will be statement 1, but if condition b is met, the next statement will be statement 2.
Conditional flow marks a branch where either one or the other statement will be run not both. -
âifâ and âelseâ
What is an expression?
A fragment of code that produces a value is called an expression.
What is a binding?
A binding is a value or string set to a variable
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.
Give an example of a function.
function hello() {
alert(âHello, World!â);
}
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.
function that produces a side effect :
function hello() {
alert(âHello, World!â);
}
function that produces a value:
console.log(Math.max(2, 4));
// â 4
What is control flow?
The order of executing code from top to bottom
What is conditional execution?
The order of executing code can branch off (if) and takes the âproper:â branch
What kind of keyword do you need to use to invoke conditional execution?
if
-
An expression is a âfragment of code that produces a value.â
-
A binding catches and holds values found in the code. A binding is otherwise known as a variable.
-
An environment is âthe collection of bindings and their values that exist at a given time.â Basically this means that you are creating a world with parameters where certain variables mean certain things. The environment can change, but it will always will have a current state defined by what you have set that state to be. Some parts of the environment are static however, since these parts are embedded into the Javascript language.
-
A function is âa piece of a program wrapped in a value.â Basically it is a set of instructions to be executed based off of the value of the variables that you feed into it.
-
alert(âFrisky Dingo is a hilarious show and you should watch it.â)
-
A side effect is a change in code that will affect the way the code that comes after it is executed.
-
Side effect - prompt(âEnter Passcodeâ)
Value - console.log(âFrisky Dingoâ + " is" + " great!") -
Control flow is the direction in which code is executed.
-
Conditional execution is when certain parameters or conditions are set in place. If those parameters or conditions are met or not, certain code will either be executed or not.
-
Keywords to prompt conditional execution include If and Else
-
Piece of code that produces value.
-
Capturing or holding value in memory.
-
Group of bindings and their values that exist at a given time.
-
Program that is saved/wrapped to value.
-
console.log() typeOf() math() alert()
-
A change of the internal state of the machine in a way that will alter the statements that come after it.
-
console.log(Math.min(1835, 923) / 2);
-
The order in which the code is processed by the console.console
-
Where a program have to choose the best choice conditionally.
-
if
@KryptoDr this is for you too!
Amazing answers sir(s)! you capture most of the knowledge on each of them. Keep it like that!
Carlos Z.
- What is an expression?
Everything that produces value. It can be anything for example a fragment of code.
- What is a binding?
It is like a tackle. it connects value to other things. It is variable.
- What is an environment?
The collections of bindings and its values are the environment.
- What is a function?
Function is a piece of program that is wrapped in a value. For example in a browser environment, the binding prompt holds a function that draw a dialog box in the console.
- Give an example of a function.
console.log(Math.min(3,5)+27);
- What is a side effect?
showinga dialog box or writing text into 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(âEnter nameâ);
Count(2,3,4,5,6);
- What is control flow?
When there are a lot of statement the execution is going from top to bottom. It can be imagined as a straight line. This means control flow.
- What is conditional execution?
When we do not go straight forward, but want to create a branch where the program flows. The program flow based on the situation and the statement execution will happen according to the situation.
- What kind of keyword do you need to use to invoke conditional execution?
if
- An expression is a fragment of code that produces a value.
- A binding is needed for Javascript to catch an hold a value.
- An environment is the collection of bindings and its values at a given time.
- A function is a piece of program wrapped in a value.
- An example of a function is the âpromptâ function. This opens a dialog box.
- A side effect is a statement that really does something inside of the computer or on the computer screen. It affects the world.
- An example of a function that produces a side effect is the prompt function.
An example of a function that produces a value is the console.log function. - A control flow is is the order in wich a program runs.
- A conditional execution is an if statement in a program. Only if the program criteria is fulfilled then it will be executed.
- A keyword you need to invoke a conditional execution is âifâ.
- What is an expression? A fragment of code that produces a value. Expressions can be nested in parentheses, and binary and unitary operators when applied to expressions are also expressions.
- What is a binding? It creates a link between a name and an expression. It can be constantly changed and updated. When you ask for a binding that has no value, the value âundefinedâ will be returned. The keyword âletâ can contain multiple bindings separated by commas. A binding can be almost any name, but most not start with a digit. There are prohibited words that are reserved for Javescript.
- What is an environment? A collection of bindings and their values.
- What is a function? A piece of programme wrapped in a value, a set of statements that performs a task or calculates a value. Functions can be âappliedâ to run the wrapped programme.
- Give an example of a function. Number () â converts an objectâs value to a number.
- What is a side effect? Showing a dialogue 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. Side effect - alert (âhello world);, value console.log (6+2);
- What is control flow? The order in which statements are executed.
- What is conditional execution? When the programme has to take a branch of code based on the situation.
- What kind of keyword do you need to use to invoke conditional execution? Else/ if.
1. What is an expression?
Expressions are units of code that can be evaluated and resolve to a value. Expressions in JS can be divided in categories (string, primary, logicalâŚ)
2. What is a binding?
binding ( = variable) is giving an element a value so it can be stored in it.
3. What is an environment?
The environment is a collection of bindings and their values that exist at a given timeâ
4. What is a function?
A function is a piece of program wrapped in a value. â
5. Give an example of a function.
ex : console.log(âhello worldâ)
6. What is a side effect?
Showing a dialog box or writing text to the screen is a side effect
7. Give an example of a function that produces a side effect and another function that produces a value.
prompt(âEnter passcodeâ) shows a little dialog box --> function with a side effect
Math.max(1, 2) --> function without side effect producing a value
8. What is control flow?
This is when statements are executed from top to bottom kind of a linear way
9. What is conditional execution?
Program sets that continue a way or another depending on the âifâ conditions are hit ( if true, if false, if yes, if noâŚ)
10. What kind of keyword do you need to use to invoke conditional execution?
IF ans ELSE
-
What is an expression? A fragment of code that produces a value.
-
What is a binding?
Binding is a variable â something to hold value to memory*** -
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.
Ex. Sum(var1, var2)*** return (var1 + var2) -
What is a side effect?
A side effect is change to the internal state of the machine in a way 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. Ex of side effect function â showing dialog box â Alert(âmesg hereâ);*** Ex. of another function that produces a value â sum function that totals sum of two argument variables arg1, arg2, such that ruturn is arg1+arg2;
-
What is control flow?
Flow control of a program involves the is the order in which*** individual statements , instructions or function calls of an imperative program are executed or evaluated. -
What is conditional execution? This is where 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
-
What is an expression?
A fragment of code that produces a value is called an expression. Every value that is written literally (such as 22 or âpsychoanalysisâ) is an expression. An expression between parentheses is also an expression, as is a binary operator applied to two expressions or a unary operator applied to one.
-
What is a binding?
You should imagine bindings as tentacles, rather than boxes. They do not contain values; they grasp themâtwo bindings can refer to the same 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. Such values can be applied in order to run the wrapped program.
-
Give an example of a function.
For example, in a browser environment, the binding prompt holds a function that shows a little dialog box asking for user input. It is used like this:
prompt(âEnter passcodeâ); -
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.
For example, the function Math.max takes any amount of number arguments and gives back the greatest.
console.log(Math.max(2, 4));
// â 4 -
What is control flow?
When your program contains more than one statement, the statements are executed as if they are a story, from top to bottom.
-
What is conditional execution?
Not all programs are straight roads. We may, for example, want to create a branching road, where the program takes the proper branch based on the situation at hand. This is called conditional execution.
-
What kind of keyword do you need to use to invoke conditional execution?
Conditional execution is created with the if keyword in JavaScript.
-
What is an expression?
An expression is any part of the code thateither is or produces any value -
What is a binding?
Binding is to link a certain value to a certain variable -
What is an environment?
Enviroment is a collection of Bindings and their values at any given time. Envireoment is never empty even at startup it contains bindings that are a part of language standard. -
What is a function?
Function is a piece of program wrapped in a value -
Give an example of a function.
prompt -
What is a side effect?
Side effect is any lasting impressions that executed code might leave on the code yet to be proccesed -
Give an example of a function that produces a side effect and another function that produces a value.
side effect;
5+3;
value;
let a=5+54;
-
What is control flow?
control flow is the terminology for the flow of the program and how it runs -
What is conditional execution?
conditional execution is where control flow has multiple options to run through but selects only the one aplicapple to the situation. -
What kind of keyword do you need to use to invoke conditional execution?
IF
- A fragment of code that produces a value
- Binding (or variable) is used to attach, hold a certain assigned value.
- An environment is a collection of Bindings and their values.
- A function is a piece of program wrapped in a value, a block of code designed to perform a particular task.
- Console.log, prompt, alertâŚ
- Showing a dialogue box or writing text on the screen is a side-effect.
- side-effectâŚ
Prompt(âHello Worldâ)
ValueâŚ
Let ten = 10;
console.log(ten * ten);
// 100 - Control Flow is when your program contains more than one statement, the statements are executed as if they a story from top to bottom.
- The Conditional Execution is where the program takes the proper branch based on the situation at hand.
- It is created with the âifâ keyword and âelseâ is used to execute the alternative.
- A piece of code, typically containing values and operators, that returns a value as an output.
- Bindings are a method of recalling values within a programâs internal state by creating a tag/connection to that value.
- Collection of bindings and their values that exist at a given time.
- Code wrapped in a value. The value is operated on within the code of the function.
- function average(x,y) {
return (x+y)/2
} - Output of a code which produces a dialogue box (e.g. prompt) or prints text onto a screen.
- Side effect function alert(âxyzâ)
Value function math.max(x,y) - Linear execution of statements, from top to bottom.
- Branch based execution driven by decision points in the code.
- if