- An expression is a fragment of code that produces a value.
- Binding is a way to catch and hold values, that can be later used as an expression.
- An environment is a collection of bindings and their values that exist at a given time.
- A function is a piece of code wrapped in a value that can be executed by calling its name with proper arguments in parenthesis.
- Math.min(5,8);
- A side effect is any effect of calling a function other than producing a value, for example showing a dialog box.
- Function Math.max(5, 9) produces a value and prompt(āHello world!ā) produces a side effect.
- Control flow is an order of executing (or not) statements in a program.
- Conditional executions allows to run portions of code only if specified conditions are met.
- āIfā and optional āelse ifā and āelseā.
- Singular values, or values derived out of combinations of several values via operators are expressions
- Javascript uses binding to catch or hold values
- The set of all variables and their values is called environment
- A small program packed into a value. Typing the specific value like āalertā, executes the program, for example pops up a window with the alert function
- answered with 4
- A side effect can be a useful attribute of a function, for example the poping up of a window of the alert function
- side effect-> alert function, value provider-> Math.max function
- The direction in which a program is executed
- In conditional execution only one of several options gets executed, depending on which condition gets fulfilled first
- if, else, elseif
-
What is an expression?
⢠A fragment of code that produces a value is called an expression. -
What is a binding?
⢠You should think of 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 ad their values that exist at a given time is called the environment. A program contains pre-determined bindings that are part of the language standard. -
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 program. -
Give an example of a function.
⢠In a browser environment, the biding prompt hols a function that shows a little dialog box asking for user input;
prompt(āEnter passcodeā); -
What is a side effect?
⢠Showing a dialog box or writing text to the screen is a side effect. A lot of functions are useful because of the side effects they produce. Functions may also produce values. -
Give an example of a function that produces a side effect and another function that produces a value.
⢠Prompt(āhello worldā);
Console.log(Math.max(2, 4)); -
What is control flow?
⢠It is the way 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?
⢠If
- A fragment of code that produces a value is called an expression.
- Binding is the way JavaScript holds onto an internal state and away for it to remember and store values.
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. 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 dialogue box that asks for user input.
- A statement that changes the internal state of the machine in a way that will effect the statements coming after it.
7.console.log produces a side effect, Math.max produces a value.
8.When your program contains more than one statement, the statements are executed as if they are a story, from top to bottom.
9.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.
10.If
- What is an expression?
A fragment of code that produces a value. - What is a binding?
A variable that is defined in the code to catch and hold value(s). These include keywords such as break, case, catch, class, const, etc. - 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 that is wrapped in a value, to be applied in order to run the program. - Give an example of a function.
prompt(āEnter passcodeā);
prompt is the bound function that shows a little dialog box asking for user input. - What is a side effect?
A change to the internal state of the machine in a way that will affect the statements that come after it, so long as they affect the function. - Give an example of a function that produces a side effect and another function that produces a value.
printZeroPaddedWithLabel \this prints a line as a side effect.
zeroPad \this produces a return value which is more useful. - What is control flow?
This is how the program is sequenced or executed, which is like a story from top to bottom. - What is conditional execution?
A ābranchā in the code that executes a certain path if and only if certain conditions hold true. - What kind of keyword do you need to use to invoke conditional execution?
A conditional keyword such as if & if else combined for more than 2 paths. Also while, do and for loops.
-
What is an expression?
An expression can be content to just produce a value, which can then be used by the enclosing code -
What is a binding?
Binding catches and holds values -
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.
prompt(āEnter passcodeā); -
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.
console.log(Math.max(2, 4)); Produces a value
prompt(āEnter passcodeā); Side effect -
What is control flow?
it means the statements are executed as if they are a story, from top to bottom -
What is conditional execution?
if we want to create a branching road, where the program takes the proper branch based on the
situation at hand - thats called conditional exection - something is done in condition of smth. -
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 is an expression
- An expression between parenthesis is also an expression
-
What is a binding?
- by using bindings a program can keep its internal state
- by using bindings it can āremember thingsā
- bindings catch and hold values
-
What is an environment?
- the collection of bindings and their values that exist at a given time
- language standard bindings are often loaded into the environment by default
-
What is a function?
- ⦠a piece of program wrapped in a value, which in turn can be applied in
order to run the wrapped program - values used given to a program are called arguments
- ⦠a piece of program wrapped in a value, which in turn can be applied in
-
Give an example of a function.
-
āsquare of a number functionā:
const square = function(x) { return x * x };
-
-
What is a side effect?
- Values returned after code execution in a dialogue box or as text written to
the screen
- Values returned after code execution in a dialogue box or as text written to
-
Give an example of a function that produces a side effect and another function
that produces a value.- makeNoise, square
-
What is control flow?
- execution of statements one by one from top to bottom
-
What is conditional execution?
- execution of code only if a certain condition is given
-
What kind of keyword do you need to use to invoke conditional execution?
- the if keyword
-
What is an expression?
A fragment of code that produces a value. -
What is a binding?
Its a key word you can set for a value, it can be changed later but in short it is useful for remembering anything. -
What is an environment?
Collection of Bindings and their values at a given time. -
What is a function?
A lot of the values provided in the default environment have the type function. A function is a piece of program wrapped in a value. -
Give an example of a function.
function countapples(Janesapples,Bobsapples)
{return Janesapples + Bobsapples}
countapples (17+3);
so the above is all the function
Janesapples and Bobsapples are both bindings
-
What is a side effect?
As the name suggests a side affect is the side effect/result of the function such as a display box -
Give an example of a function that produces a side effect and another function that produces a value.
The function I gave earlier in point 5 gives a value 20
alert(āHelloā); has the side affect of the display box -
What is control flow?
The way the program is sequenced or executed from top to bottom like a story. -
What is conditional execution?
Conditional execution is created with the if keyword in JavaScript. In the
simple case, we want some code to be executed if, and only if, a certain condition
holds. -
What kind of keyword do you need to use to invoke conditional execution?
if
- A piece of code that produces a value.
- a binding is a variable or constant that allows you to catch and hold values.
- The collection of bindings and their values that exist at any given time, including those that are part of the language standardā¦
- A piece of program wrapped in a value.
- prompt(āUsernameā);
- Showing a dialogue box or writing text to the screen.
- alert(āHiā); produces a side effect, and Math.min(2, 6); produces a value.
- Itās the flow or order of execution of a given program.
- Conditional execution uses the if keyword, and only executes if specified conditions are met.
- if
1.What is an expression?
code that produces value is called an expression. Every value
that is written literally is an expression. An expression can be content to just produce
a value.
2.What is a binding?
a variable that catches or holds a value.
let x = 4*6; these (keywords) var/const/let indicates that this sentence is going to define a binding.
3.What is an environment?
The collection of variables (bindings) and their values that exist at a given time is called the environment.
You can work on the environment via the browser,console or a text editor.
4.What is a function?
A piece of program wrapped in a value. Can be applied in order to run the wrapped program.
they hold keyword function followed by itās name. After we assigned paranthesis that can hold
arguments, which hold values given to the function, followed by curly braces and the logic insided the
curly braces (body of the function).
5.Give an example of a function.
prompt(āEnter nameā); this binding prompt holds a function that shows a little dialog box asking for
user input ā¦name.
console.log();
6.What is a side effect?
statements that display something or it could change the internal state of the machine in a way that
will affect the statements that come after it. Showing a dialog box or writing to the screen.
Give an example of a function that produces a side effect and another function that produces a value.
Math.max(3,6) => it produces a value. which is used to return that value.
prompt() => is a side effect function.
7.What is control flow?
A program that contains more than one statement being executed as if they are a story,
from top to bottom.
8.What is conditional execution?
a piece of code created with the if keyword to be executed followed by a certain condition
it it holds. A logical program that takes the proper branch based on the situation at hand.
9.What kind of keyword do you need to use to invoke conditional execution?
if/else if/ else
- A fragment of code that produces a value.
- Itās away to hold onto a value by pointing a variable to it.
- Itās the existing universe of values and bindings at any given moment.
- Functions a re program pieces that can be called upon by applying the value.
- alert(āDanger!ā);
- A side effect is when a statement produces a change somewhere outside of its scope, such a dialog box in the browser.
prompt("This is a prompt");
console.log((4+2)>5);
- It is the order in which statements are read and evaluated in a program.
- It is when we determine that a statement be evaluated depending on a boolean value.
- We can use
if
andelse
.
- An expression is any kind of content used to produce a value.
- Binding is the process of storing a value in computer memory which can be re-used at a later time and can be referred to with a name.
- All the bindings that exist when a program is started is called the environment.
- A function is a block of code that returns a value.
- alert (āThis is a messageā)
- A side effect is the result of a function producing some state or effect outside of the current scope without returning a value.
- Side effect: alert (āThis is a messageā) creates a prompt on the screen showing āThis is a messageā.
Value: let val = 5*5 produces a value of 25 and sets the binding Val as 25. - The order in which statements are executed.
- A certain block of code will only execute when a condition is met.
- If and else
1.An expression is any fragment of code that result in a value or assign to a value.
2. A binding is a location or variable that hold a specific value, they grasps information and donāt hold them. It act like sort of a tentacle.
3.The environment is a collection of bindings and their value assigned that exist in a given time.
4.A function is a specifically created internal logic in a program section that is used to perform a specific task.
5.alert(āhi,worldā);
6.A change in the programās state caused by an expression or a function call in procedural.
7.prompt(ātype your nameā); (a dialog box or writing text to the screen is a side effect)
8.a control flow statements contains statements of different situation that can be execute with the right condition.
9. Conditional execution is created with the IF key word to fulfill a certain condition.
10.if and else
-
A fragment of code that produces a value is called an expression.
-
To catch and hold values, JavaScript provides a thing called binding or variable.
-
The collection of bindings and their values that exist at a given time is called the environment.
-
A function is a piece of program wrapped in a value.
-
Console.log
-
An operation, function or expression is said to have a side effect if it modifies some state variable value(s) outside its local environment.
-
Function as value:
var BobsAge = 30;
console.log(BobsAge);or
function myFunction (a,b) {
return a*b;
}
var x = myFunction (4,3);
xFunction with side effect:
alert (āHello, JavaScriptā); -
In a program, the statements are executed as if they are a story, from top to bottom. This is how we define control flow.
-
Conditional execution controls whether or not the core will execute an instruction.
-
The keyword for conditional execution is āifā.
An expression is code that produces a value.
A binding is something that catches and holds a value.
The environment is the collection of bindings and their values that exist at a given time.
A function is a piece of a program wrapped in a value.
function crazyDelicious() {
console.log(āCupcakes!ā)
}
A side effect is a real world effect that a statement makes.
alert(āMake a side effectā);
produce = 21000000, val = ābitcoinā
produce + " " + val;
Control flow is the order of how a programās code is executed, top to bottom.
Conditional execution allows a program to branch in a different direction when certain conditions are met.
- if
- else
- if else
- Expression: A fragment of code that produces a value.
- Binding, or Variable: to catch and hold values. After a binding has been defined, its name can be used as an expression. The value of such an expression is the value the binding currently holds.
- Environment: The collection of bindings and their values that exist at a given time.
- *function: A function is a piece of program wrapped in a valued.
- function c() {
console.log(āHello Worldā);
}
c();
var d = āLive in Peaceā
console.log(d) - Side affect: changes the intenal state of the āmachineā in a way that will affect the statements that come after it.
- let amount = 1;
while (amount <= 10){
amount = amount + 2;
}
console.log(āafter the count is doneā, amount); - Control flow: This is the way Javascript executes code. Its not always top to bottom but in the order of operations.
- Conditional Execution: āIf this happens then let this happenā These are loops with keywords such as if, else, while, true, or false.
- Conditional Execution Keywords: 1. if, else, else if , while.
- What is an expression?
A fragment code that produces a value is called an expression.
- What is a binding?
In JavaScript you use āBindingsā to catch and hold values for future use.
- What is an environment?
Is a collection of bindings and their values that exist at a given time.
- What is a function?
A piece of program wrapped in a value.
- Give an example of a function.
prompt(āEnter passcodeā);
- What is a side effect?
The result that a function produces. An example of a side effect is showing a dialog box or writing text to the screen as a result of a function.
- Give an example of a function that produces a side effect and another function that produces a value.
Function: prompt(āEnter passcodeā); gives you the side effect of a Dialog Box asking for the passcode.
Function: console.log produces a value
- What is control flow?
When your program contains more than one statement, the statements are executed as if they were a story from top to bottom (control flow)
-
What is conditional execution? Not all programs are straight roads. An example of a conditional execution is when a programmer wants to create a branching road, 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ā keyword in the case of JavaScript
- A fragment of code that produces a value is called an expression. I explain by metapher. The operator is the verb, the value the subject and object, the expression is the complete sentence, finished by an semicolon.
2.To catch and hold values, JavaScript provides a thing called a
binding, or variable. We define and group values, and we are binding the definition name and the value by operators. The name can be used after definition as an expression.
3.The collection of bindings and their values that exist at a given time is called
the environment., it contains bindings. When a programme is starting, the envirement is never empty.
4.A function is a piece of program wrapped in a value. The values in a function are called arguments. - console.log is a function. It creates an text output in the device.
6.Showing a dialog box or writing text to the screen is a side effect
7.Math.max produces value and console.log a side effect. - The control flow is the way of execution of the statements. When your program contains more than one statement, the statements are executed as if they are a story, from top to bottom
9.By using the word āifā we create special conditions in the way of executing. It depends on the situation how the stateemnts will be executed. - The keyword are āifā and āelseā.
- What is an expression?
An expression is a fragment of a code that produces a value. - What is a binding?
A way to attach a value to a variable - What is an environment?
A collection of bindings with their values at a given point in time. - What is a function?
A piece of program that takes arguments and returns a value. - Give an example of a function.
function square(number) {
return number * number;
} - 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.
The Alert function - What is control flow?
It is how the statements are executed. - What is conditional execution?
It is the execution of a statement based on the condition of the value of an expression - What kind of keyword do you need to use to invoke conditional execution?
if
- piece of code that produces value
- binding is way to store values
- collection of bindings that exist at a given time
- pieco of program under the hood, represented by value
- prompt
- effect produced by the function, does not have to be value only
- prompt produce a side effect - popping up windov, math.max produce highest number from inserted numbers
- way how commands are executed, from top to bottom
- function will be executed only if certain conditions are met
- if and else