-
What is an expression?
A fragment of code that produces a value. -
What is a binding?
Mechanism JavaScript uses to catch and hold variables, by establishing a relationship between a variable and a 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.
console.log() -
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.
side effect: prompt(); value: Math.max(); -
What is control flow?
The order in which individual statements, instructions or function calls of an imperative program are executed or evaluated. -
What is conditional execution?
Conditional execution controls whether or not the core will execute an instruction. Most instructions have a condition attribute that determines if the core will execute it based on the setting of the condition flags. -
What kind of keyword do you need to use to invoke conditional execution?
âifâ or âelseâ or âif elseâ
- Any valid unit of code that produces a value is called an expression.
- Bindings or variables are containers for storing data (values).Or more accurately, you should imagine bindings as tentacles, rather than containers. Because bindings (as their name suggests) do not âcontainâ values; they âgraspâ them, e.g. two bindings can refer to the same value.
- A collection of bindings and their values that exist at a given time is called the environment.
- A function is a block of code designed to perform a particular task. A JavaScript function is executed when âsomethingâ invokes it (calls it) in order to run the wrapped program.
- Using console.log to output values when in the JavaScript console of all modern web browsers is an example of a function.
- Showing a dialog box or writing text to the screen is known as a side effect. A lot of
functions are useful because of the side effects they produce. - In a browser environment, the binding prompt is an example of a function that produces a side effect that shows a little dialog box asking for user input. Whereas, an example of a function which produces a value, is the function Math.max which takes any amount of number arguments and gives back the greatest e.g. console.log(Math.max(2, 4)); // â 4.
- When your program contains more than one statement, the statements are executed as if they are a story, from top to bottom; this is known as control flow. The semicolon (
;
) character is used to separate statements in JavaScript code. - 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.
- You need to use the âifâ keyword to invoke conditional execution in JavaScript.
- It is a fragment of code that produces a value.
- Itâs something used to catch or hold values.
- Itâs a collection of bindings and their values that exist at a given time.
- It is a piece of program wrapped in a value.
- prompt(âEnter Passwordâ);
- Itâs what is produced by the function such as a dialog box.
- a) prompt(âEnter passwordâ);
b) console.log(Math.max(2,4)); - When your program contains multiple statements they are executed from top to bottom.
- When a program takes the proper branch based on the situation at hand.
- if, else if, else.
- A fragment of code that resolves to any value.
- A tool that is used to catch and hold values. They do not âcontainâ values; they âgraspâ them. Bindings can be created by using the let. var. or const. terms.
- 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.A lot of the values provided in the default environment have the type of function.
5.Number(prompt(âpick a numberâ). - Any application state change that is seen outside of the scope of the called function is a side effect. Showing a dialogue box or writing text to a screen is a side effect.
- Prompt(âenter passwordâ). Produces a drop down asking for a password.
OR
Console.log(Math.max(2,4)). Outputs the largest number inside the brackets. - /Control flow is the way in which code is executed; as a story from top to bottom.
- Where the code is executed provided a condition is met.
- if, if.else, while, do and for
- What is an expression?
- A fragment of code that produces a value is called an expression. Every value
that is written literally. Expressions can contain other expressions
- What is a binding?
- 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
- 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?
- 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 is a side effect
- Give an example of a function that produces a side effect and another function that produces a value.
-
prompt(âEnter passcodeâ);
-
console.log(Math.max(2, 4));
// â 4
- What is control flow?
- the statements are executed as if they are a story, from top to bottom
- What is conditional execution?
- Conditional execution is created with the if keyword. If you have more than two paths to choose from, you can âchainâ multiple if/else pairs together
- What kind of keyword do you need to use to invoke conditional execution?
- if/else
-
What is an expression?
A fragment of code that produces a value -
What is a binding?
Binding a statement that allows JS to hold values. Binding is also called a variable. -
What is an environment?
The collection of bindings and their values that exist at any given time. -
What is a function?
A function is a type of program wrapped in a value. These values can be apply to run the wrapped program. -
Give an example of a function.
var welcome = function (greetings, name) {
return greetings + name
};
var welcome(âHelloâ, âAllâ)
-
What is a side effect?
Side effects are changes to statements made by the internal state of the machine after executing previous statements. -
Give an example of a function that produces a side effect and another function that produces a value.
// function with a side effect
alert(âHello Worldâ)
// function with a value
console.log( Math.max (2, 4));
// 4
-
What is control flow?
Control flow is the order in which our programs are executed, from top to bottom. -
What is conditional execution?
A conditional execution runs our code if a first condition happens first -
What kind of keyword do you need to use to invoke conditional execution?
The keyword if, else
- What is an expression?
âA fragment of code that produces a value.â It may on its own or in combination with others, most often followed by a semicolon, form a statement.
- What is a binding?
A binding is a variable, given a value in a statement beginning with the âletâ , âvarâ and âconstâ commands for example.
- 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.
An example is what may show a dialog box asking for user imput
- What is a side effect?
Instead of producing a value, it effects subsequent statements.
- Give an example of a function that produces a side effect and another function that produces a value.
An example outcome of a function as a side effect is a dialog box. An example of a function producing a value is the product of simple arithmetic appliying a binary operator to two existing values.Such is an argument.
- What is control flow?
Control flow appears to refer the process of consequetive function execution where the input of the latter is dependent on the output of the former.
- What is conditional execution?
This is when a latter function applies a condition to a previous functions output such that if that output is of a certain type then what is executed by the latter function is different to if the earlier output was a different type.
- What kind of keyword do you need to use to invoke conditional execution?
using the âifâ keyword
-
What is an expression?
A fragment of code that produces a value. -
What is a binding?
Binding is the relationship between a name and a value in JavaScript. -
What is an environment?
Environment is the collection of bindings and values in the current session or page. -
What is a function?
A function is a piece of program wrapped in a value. -
Give an example of a function.
prompt(âpress any key.â); -
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.
side effect: console.log(), value: Math.max() -
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?
A part of the code is only executed if a defined condition is met. -
What kind of keyword do you need to use to invoke conditional execution?
If is the word used to invoke conditional execution.
- What is an expression?
a fragment of code that produced a value. - What is a binding?
a program that keeps an internal state by remembering values in order to use it later. - 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(âprivate keyâ); - What is a side effect?
a dialog box or writing text to a screen is a side effect. - Give an example of a function that produces a side effect and another function that produces a value.
alert(âthanks for sharing your private keyâ)
console.log(Math.max(2,4));
// 4
when a function produces a value it is said to return that value - What is control flow?
Control Flow is a fundamental concept in programming that allows you to dictate how your code runs under different conditions or until a certain condition is met. - What is conditional execution?
a program that takes some code to be executed if and only if a certain condition is met. - What kind of keyword do you need to use to invoke conditional execution?
if/else
- An expression is a piece of code that produces a value
- A binding is used to catch or hold values, let, var and const are used to create bindings
- The environment is the collection of all bindings that exist and any given time
- A function is a piece of program wrapped in a value, it performs a task or produces a value
- Number (prompt (âpick a numberâ));
- A side effects of a function can show a dialogue box or writing text to the screen
- Function with a side effect alert (âhello worldâ); with a value console.log (Math.min (10, 20) *2);
- The order in which the JS statements are set out, from top to bottom
- A condition execution is where a part of code is executed only when certain conditions are met.
- You can create this using the if keyword and chain multiple paths / options using the if and else keywords
-
What is an expression?
A fragment of code that produces a value is called an expression. -
What is a binding?
To catch and hold values, JavaScript provides a thing called a
binding, or variable.
The special word (keyword) let indicates
that this sentence is going to define a binding. It is followed by the name of
the binding -
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 getNumber (number1, number2){
return (number1 + number2);
} -
What is a side effect?
Side Effects are effects that change 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.
function sideEffect {
A = false;
}
function value {
return _value;
} -
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.
- Every written value is an expression.
- A kind of statement to catch and hold a values.
- The collection of bindings and their values that exist at a given time is called
the environment - Function is a piece of program wrapped in a value. Such values can be applied
in order to run the wrapped program. - console.log
- When a statement change something.
- console.log produces side effect, Math.max produces value.
- Control flow is the order of the executed statements.
- Conditional execution is created with the if keyword, to create branching roads of execution order based on the situation at hand.
- if
- What is an expression?
A fragment of code that produces a value
- What is a binding?
A binding catches and holds values in Javascript
- 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 Ageâ);
- 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 produces a side affect
- math.max produces a value
- What is control flow?
The order in which the computer executes statements in a script.
- What is conditional execution?
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
- An expression is code that produces a value
- A binding is data being linked to a variable to be called at a later time
- An environment is the totality of bindings that exist at a given time
- A function executes specific preset instructions
- function sum(a,b){
return a+b;
} - A side effect is the an effect of a function.
- A function that produces a text box for input is a function that produces a side effect. A function like the example i gave in question 5 is an example of a function that produces a value.
- Control flow is the order in which a program is executed.
- A conditional execution is when different lines of code could execute based on what happened previously
- if and else statements
- An expression is a fragment of code
- binding is the processing of roping in a value . The book gave the example of âtentaclesâ around a value .
- An environment is a collection of bindings and related values.
- A function is a program wrapped to a value .
- let âaâ=2; let âbâ=5
- If the statement modifies the state of something unintended
- control flow is logic applied to our code
- IF Else
- An expression is a fragment of code that produces a value.
- A binding is a variable.
- An 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.
- An example of a function is a dialog box asking the user for input.
- A side effect is the image of the dialog box appearing on the userâs computer screen through a webpage function.
7.An example of a function that produces a side effect is a dialog box that appears after clicking a button on a webpage. An example of function that produces a value is console.log calculating a mathematical equation and producing a numeral value. - Control Flow is the way the statements within the program occur within the functionality of the program running on the computer.
- Conditional Execution is how the statements within the program create a control flow within the programâs functionality.
- A keyword you need to use to invole a conditional execution is an if statement.
- An expression is a fragment of code that produces a value.
- A binding is a variable.
- An 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.
- An example of a function is a dialog box asking the user for input.
- A side effect is the image of the dialog box appearing on the userâs computer screen through a webpage function.
- An example of a function that produces a side effect is a dialog box that appears after clicking a button on a webpage. An example of function that produces a value is console.log calculating a mathematical equation and producing a numeral value.
- Control Flow is the way the statements within the program occur within the functionality of the program running on the computer.
- Conditional Execution is how the statements within the program create a control flow within the programâs functionality.
- If, if else, while, loop, true/false
-
An expression is a fragment of code that produces an expression.
-
A binding is what assignâs a variable a value.
3.An environment is collection of bindings and their values at a given time.
- a function is a piece of a program wrapped in a value.
5.example of a function console.log( x = 5);
6.A side effect is when a function shows text or a dialog box in the browser when it is invoked.
7.The prompt(enter name); function will produce a dialog box asking for a name.
8.The console.log( " " ) will produce values that you have defined.
9.A control flow is the order your program is executed; From top to bottom without a conditional execution.
- A conditional execution is just that. It places conditions on the execution of your program with the keyword IF
-
An expression is a piece of code that evaluates to a value.
-
A binding is a synonym to a variable. A variable contains a value that can later be changed. It is a placeholder for a value. You have to declare your bindings with the keyword âletâ (or âvarâ or âconstâ). Any word, except the keywords, can be declared as a binding.
-
The environment is whatever bindings and values that exist at a certain moment in time.
-
A function is a set of statements that performs a task or calculates a value. Some are predefined in the environment and some are defined by the user.
-
The predefined function âprompt()â takes one argument. When you invoke this function it prints a dialog box on the screen with the string you gave as an argument and the user input will be the value that the function returns.
-
A side effect is any state change (outside the called function) other than its return value.
-
âprompt()â produces the side effect of a dialog box. âMath.max()â returns a value. The value consists of the greatest number of any amount of number arguments.
-
The order in which a computer program is executed. In JavaScript the execution order is top to bottom.
-
Conditional execution splits the top to bottom control flow into two or more different directions depending on whatever conditions that the programmer defines.
-
âifâ
-
What is an expression?
An expression is a fragment of code that produces a value. -
What is a binding?
A binding is a mechanism used in Javascript to hold on to a value for short term or long-term subsequent 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(1+2) -
What is a side effect?
A side effect is an âeffectâ that is produced as a result of an expression. Showing a dialog box or writing text to the screen are examples of a side effect . -
Give an example of a function that produces a side effect and another function that produces a value.
The âalertâ function is an example of a function that produces a side effect (the side effect being the dialog box that opens up as a result of the âalertâ function.
The âconsole.logâ is an example of a function that produces a value. -
What is control flow?
Control flow is the top-down direction of the execution of a program. -
What is conditional execution?
A conditional execution is a way for a program to respond based on criteria that are specified in the program. -
What kind of keyword do you need to use to invoke conditional execution?
The âifâ keyword is used to invoke conditional execution in a program.