-
What is an expression?
A code or a fragment of it -
What is a binding?
Binding is a Variable or Constant “Tentacle” -
What is an environment?
A session of Bindings, Functions, etc -
What is a function?
Piece of code wrapped in a value -
Give an example of a function.
CountApples(AppleType1, AppleType2) {return AppleType1 + AppleType2; } -
What is a side effect?
Appearing of a dialogbox -
Give an example of a function that produces a side effect and another function that produces a value.
Prompt as well as Math. Max() -
What is control flow?
Order of execution -
What is conditional execution?
Producing different orders by a Condition -
What kind of keyword do you need to use to invoke conditional execution?
If
1: An expression is a fragment of code that produces a value being called an expression.
2:A binding is a variable that can catch and hold the values that the Javascript provides…. remembering.
3:Environments are a collection of bindings and their values at a given time.
4: Functions are a piece of program wrapped in a value…applied to run the wrapped program.Executing a function is called invoking, calling, or applying it.
5:A function example; i.e prompt (“How do you do this”)
6:A side effect is a change that affects the statements ;in the program… that come after it.
7:Writing text to the screen is a side effect.
8:Control flow is the order that the computer executes the statements in a script
9:Conditional execution is taking a program into another direction an takes the proper branch based on the situation at hand.
10; Keywords like if or else invoke conditional execution.
1. What is an expression?
- A piece of code that produces a value is called an expression. An expression between parentheses
is also an expression, as a binary operator applied to two expression, or unirary operator applied to one.
2. What is a binding?
- Binding is what JavaScript uses to catch and hold values. It is also called Variable.
3. What is an environment?
- A collection of bindings and their values that exists at a given time is called environment
4. What is a function?
- A function is a piece a program wrapped in a value, can be applied in order to run the wrapped program.
5. Give an example of a function.
- example: In a browser environment the binding “prompt” holds a function that shows a little dialog box asking for user input.
6. What is a side effect?
- Showing a dialog box or writing text on 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.
- console.log(math.min (3, 9)):
// --> 3 - console.log (math.max (8, 10)+5));
// --> 15
8. What is control flow?
- When a program contains more than one statement, the statements are executed as if they are a story, from top to bottom.
9. What is conditional execution?
- Since not all programs are straight road, we may want to create a branching road, when it is necessary, the program takes the proper branch based on the given situation at a time.
10. What kind of keyword do you need to use to invoke conditional execution?
- if, and only if
- An expression is a fragment of code that expresses a value
- A binding is a variable used to catch and hold a value
- An environment is a collection of bindings and their values that exist at a given time
- A function is a piece of program wrapped in a value
- let a = 15
- An expression that changes the internal state of the machine in a way that will affect statements that come after it is a side effect
- Side effect (var a + 15); Value (alert(a + a))
- Code is executed like a story from top to bottom, control flow is the order in which the code is executed
- a line of code that is only executed if the given parameters are "true" is conditional execution
- To evoke conditional operations, use the work "IF"
-
What is an expression?
A fragment of code that produces a value -
What is a binding?
To catch and hold values -
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.
r 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 -
Give an example of a function that produces a side
effect and another function that produces a value.
Math.max and Math.min -
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?
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
- An expression can be anything from just a straightforward value that you write, like a number or a word, to a more complex code that involves functions, or even functions within functions. An expression could be just a fragment of what’s called a statement, which typically ends with a semicolon.
- A binding is a way to get some value stored in the programs memory, so that it doesn’t just spit out a value and let it go.
- The environment of a program is the entire set of bindings currently held and understood in the program’s memory.
- A function is a type of expression that can manipulate and act upon a value (in which case the value is called an argument, which is supplied to the function). A function can also be thought of as a type of binding which has instructions that can be applied to the arguments supplied in parentheses.
- Number.isNaN(), isNaN(), prompt()
- A side effect occurs when a function shows a dialogue box or writes text to a screen.
- Prompt() produces a side effect (the box to enter a string), and math.max() would be a function that produces just a value.
- Control flow descibres the general unidirectional flow of code execution. The program will execute one line after another, in order.
- Conditional execution involves a variable execution of code. You might want the program to do one thing if the result of a line of code is x, but to do something else entirely if the result of a line of code is y.
- You would use if and else keywords.
What is an expression?
A fragment of code that produces a value is called an expression.
What is a binding?
Bindings (variables) catch and hold values.
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.
console.log function
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.
Side Effect- console.log(Math.max(2, 4)); // → 4
Value- console.log(Math.min(2, 4) + 100); // → 102
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?
IF
- An expression is any portion of code that produces a value.
- A binding is a variable used to store a value, once this value is defined, the binding becomes an expression.
- The environment is where the bindings and their values hang out in the program memory ready to be used.
- A function is a piece of program/code wrapped in a value that performs a specific task when prompted.
- An example of a function:
alert (“kia ora”)
This results in a pop up window with the traditional New Zealand greeting. - A side effect is any statement that changes anything that follows it.
Function showMessage(){
alert (“Greetings Earthlings”);
}
showMessage();
8. Control flow is the order with which statements are evaluated.
9. Conditional execution occurs when a piece of code is executed if a certain condition(s) is met.
10. IF is the keyword to invoke a conditional execution.
- An expression is a piece of code that produces a result
- Binding is an assignment of a value to a variable which is stored in JS
- An environment is a collection of bindings and their values at any given point of time.
- A function is a piece of program that executes a specific task.
- alert(‘Good Morning Crypto’)
- A side effect is a statement or function that an user interact with it (like an alert/prompt)
- a) Side effect: alert(‘Good Morning Crypto’)
b) Function that produces a value: console.log(Math.max(1,2)) - Control flow is the direction / order in which the code is executed
- A conditional execution is invoked by keyword “if”
- An expression is a fragment of code that produces a value.
- A binding is used 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 which holds a function that shows a little dialog box asking for user input.
- Showing a dialog box or writing text to the screen is a side effect.
- The prompt function produces a side effect while the Math.max function returns a value.
- Control flow is when a program contains more than one statement and those statements are executed from top to bottom.
- Conditional execution is when a program is not a straight road and contain branching roads based on the situation at hand. Some code will be executed if, and only if, a certain condition holds.
- If and else.
- Expression is a fragment of code that produces a value
- Binding is used to hold numbers, similar to variables
- collection of binding and their values that exist at any given time
- program wrapped in a value, a piece of code that does more than one action
function add(first, second){
var sum = (1 + 2);
return sum;
}
console.log(add());
- statement that effect a change
function test(name, age){
var ageName = ("gloria is" + " "+34);
return ageName;
}
console.log(test());
b. console.log (Math.min(9,3) + 34);
8. when multiple statements in a program are executed from top to bottom
9. a program that is not executed in a straight line, it takes different branches depending on the situation
10. “if” keyword
-
A fragment of code that produces a value.
-
A binding or variable catches and holds values in Javascript.
-
The environment is the collection of bindings and their values.
-
A function is a piece of program wrapped in a value.
-
prompt(“Enter email”);
-
A side effect is showing a dialog box or writing text to the screen.
-
console.log(Math.max(2, 6));
// → 6console.log(Math.min(4, 8) + 100);
// → 104 -
When a program contains more than one statement, the statements are executed as if they are a story, from top to bottom.
-
Where the program takes the proper branch based on the situation at hand.
-
if.
- Expression is a fragment of code that produce a value
- Binding is provided in Javascript to catch and hold values
- Environment is collection of bindings and their values that exist at a given time
- A function is a piece of program wrapped in a value
- For example, in a browser environment, the binding prompt holds a function that shows a little dialog box asking for user input.
- Side effect is showing a dialog box to the screen
- console.log(firstAccount);var firstAccount = accounts[0];
- Control flow is When your program contains more than one statement, the statements are executed as if they are a story, from top to bottom. This example program has two statements.
- Conditional Execution is when the program takes the proper branch based on the situation at hand.
- If and else
What is an expression?
- A fragment of code that produces a value.
What is a binding?
- It binds a variable to an expression, allowing you to call back to it later.
What is an environment?
- The entire collection of bindings & expressions is called the Environment.
What is a function?
- It’s a piece of program wrapped in a value.
Give an example of a function.
- prompt("Enter Username:);
What is a side effect?
- When you display a dialog box or written text on 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));
What is control flow?
- The way a program is executed, from top to bottom, like a story.
What is conditional execution?
What kind of keyword do you need to use to invoke conditional execution?
- You need to use the ‘if’ keyword.
- Expression is a piece of code that results in a single value
- Binding is attatching a keyword to a value
- An environment is set of variables and their values that exist in memory at a given time.
- A function is a subprogram that can be called…
- console.log (“Tere”) returns Tere
- A side effect is changes that can occur outside of the called function.
- console.log produces side effect and (Math.max(2, 4));
will output a value that is 4 - Control Flow is the order in which the code is executed.
- When the code executes based on conditions give to it.
- if, else, while, loop
- A fragment of code that produces a value
- A binding is a king of tentacle to grasp a value
- The collection of binding and their values that exist at a determine point in time.
- A function is a piece of program wrapped in a value
- prompt (“enter password”);
- Writing text to the screen
- console.log (math max (3, 5) ) ;
// 5 this is an example of function that produce a value, not sure about a function example that produce side effect although I understand the concept of side effect. - When the program contain more than one statement, they are executed from top to bottom.
- Conditional execution is created with the word if. When we want a code to be executed only if certain condition hold.
- The key word if
- expression is any value
- binding helps to connect the value to the binding word
- environment is a set of bindings and values
- functions are a lot of values in a default environment
- alert (“hello”)
6.side effect is when expression is changing the internal state of the machine
7.- prompt(“Enter passcode”); has the side effect of a prompting dialogue box.
- console.log(Math.max(2, 4)); produces no side effect, though produces a value.
- control flow is basically the way the machine executes the expressions looks like this" ------------->" - STRAIGHT forward
9.itis operated with the keywords “if” and “else” to create multiple ways of processing the values or expressions
10 if and else
1.)
An expression is a pice of code that results to a value.
2.)
Binding are used to catch and hold values.
let name = 5 * 5;
After a binding has been defined, its name can be used as an expression.
3.)
The collection of bindings and their values that exist at a given time is called
the environment.
For example in a browseror in Atom there are functions to interact with the
currently loaded website and to read mouse and keyboard input.
4.)
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.
5.)
6.)
A side effect is a change of sysem state or observable interaction with outside world that occurs during the calculation of a result.
Bad written code can also change the internal state of the machine in a way that will affect the statements that come after it.
7.)
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.
- alert(“hello world”)
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. This is called conditional execution.
10.)
if
1. What is an expression? A fragment of code that produces a value is called an expression.
2. What is a binding? A variable is also called a binding and it represents chunks of information.
3. What is an environment? An environment is any platform, such as a browser, web server, coffee machine, etc., that runs Javascript.
4. What is a function? A function is a piece of program that is wrapped in a value.
5. Give an example of a function. This code defines square to refer to a function that produces the
square of a given number:
const square = function(x) {
Return x * x;
};
console.log(square(12));
// returns 144
6. What is a side effect? A good definition of a javascript side effect is any application state change that is observable outside the called function other than its return value. Examples include: a function that takes two parameters, multiplies them together, and prints them out to the console. Printing out to the console changes the state outside the function itself. Also invoking a method on an object, changes the internal state of the object.
7. Give an example of a function that produces a side effect and another function that produces a value. An example of a function that produces a side-effect:
alert(‘Hello World!’);
An example of a function that produces a value:
Math.max(a,b);
8. What is control flow? Control flow is the order in which the computer executes statements in a script. Computer code will run in order from the first line to the last unless it encounters conditional flow structures such as loops, if-else statements, and functions.
9. What is conditional execution? Conditional execution in a program takes place when statement execution is carried out only if a specific condition is met.
10. What kind of keyword do you need to invoke conditional execution? Using if, else, and switch will work in JavaScript for conditional execution.
- An expression is a fragment of code that results in a value.
- A binding ‘points’ a variable to a value. It’s almost like you’re naming a variable.
- An environment is a set of variables and their values that exist in memory at a given time.
- A named section in a program that performs a specific task.
- alert(“do not be alarmed by this alert”)
- A side effect is an observable change in the state of the application
- alert(“while you should not be alarmed there are side effects”);
console.log(2*2); - Control flow is essentially order of execution.
- Code that is executed only after specific conditions have been met.
- If