- What is an expression?
fragment of code that produces a value - What is a binding?
catch and hold values, similar term: variable - What is an environment?
collection of bindings and their values that exist at a given time - What is a function?
piece of program wrapped in a value - Give an example of a function.
Promp function - What is a side effect?
Output of a function - Give an example of a function that produces a side effect and another function that produces a value.
Promp function, console.log - 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?
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
-
Any piece of code that results in a value.
-
A binding grasps or points a variable to a value.
-
A set of bindings and their values existing at any point in a program.
-
A piece of a program wrapped in a value.
-
alert(âHello Worldâ);
-
When a function affects the state of something else outside of its own parameters, it is causing a side effect.
-
const makeNoise = function() {
console.log(âPling!â);
}makeNoise();
console.log(Math.max(2, 4));
- When your program contains more than one statement it is read from top to bottom.
- When the program takes the proper branch based on the situation at hand.
- if, else
- a fragment of code that produces a value
- binding is giving an element a value so it can be stored in it.
- is a collection of bindings and their values in a certain frame of time.
- a piece of program warped in a value, is a price of code that performs a specific task and usually returns a value.
- prompt, alert, console.log
- If a statement or function modifies the state of something else (outside its own scope), then it is
producing a side effect. - prompt(âEnter your nameâ);
value example
console.log(Math.max(2, 4));
it will output a value that is 4 - Control flow is wow the program is executed (from top to bottom).
- is a function that allows the program execute some code if the statement provided agrees with the condition.
- IF
- Itâs a combination of values and functions that are combined and interpreted by the compiler to create a new value
- binding (variable) is an application programming interface (API) that provides glue code specifically made to allow a programming language to use a foreign library or operating system service.
- Environment are bindings and their value that exist at a given time.
- Function is a peace of program wrapped in value.
- alert (âhelloeveryoneâ)
- A side effect is if a function relies or modifies something outside its parameters.
- alert âfunction that produces a side effectâ
console.log (1+2) produces a value - When your program contains more than one statement, the statements are
executed as if they are a story, from top to bottom. - Conditional execution means that it will just get executed if certain conditions are fulfilled (true).
- If while loop
-
What is an expression?
Any unit of code that can be evaluated to a value is an expression. -
What is a binding?
Binding something in JavaScript means, recording that identifier in a specific environment record. -
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 set of statements that performs a task or calculates a value. -
Give an example of a function.
function numbers (9*2) {
return numbers;
}
-
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 myFuction () {
alert (âside effectâ);
}
function myFuction (9*2) {
return myFuction;
}
-
What is control flow?
The control flow is the order in which the computer executes statements in a script. -
What is conditional execution?
You use if in Javascript and only if the specified condition is true it will be executed. -
What kind of keyword do you need to use to invoke conditional execution?
If, else, else if
What is an expression?
An expression is a fragment of a code that produces a value
What is a binding?
A binding, or varible, is used to hold values
What is an environment?
An environment is a collection of bindings and their values that exists at a given time
What is a function?
A fuction is a piece of program wrapped in a value
Give an example of a function.
alert(âhelloâ);
What is a side effect?
A side effect can be 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.min(2, 4));
What is control flow?
Control flow is the fact that a program executes the statements from top to bottom, like a story
What is conditional execution?
Conditional execution is when you use an if statement, meaning it only executes if the condition applies. There can also be more than one condition.
What kind of keyword do you need to use to invoke conditional execution?
You will need the keyword if
- An expression is a piece of code that produces any type of value. You can nest an expression within another expression.
- A binding (or variable) is a statement that we can assign a value to, either by assigning it with a value or by assigning it with a piece of arithmetic.
- 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.
- A prompt on a website that requires user input.
- A side effect is what happens when the result of a statement goes on to affect a subsequent line(s) of code.
- Writing text to a screen (âconsole.log()â) or showing a prompt (âprompt()â) is a side effect.
- The control flow is the order in which the code is executed. The control flow can be linear or use conditional execution like if statements or use while and do loops, etc.
- Conditional execute loops are used when you need to have two âroadsâ to go down based upon a returned value or a user input.
- If / If Else, etc.
-
An expression is a fragment of code that produces a value. Expressions can contain other expressions that contain other expressions. Or a value written literally can be an expression.
-
Bindings are used to catch and hold values, useful for tracking state in your program.
-
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. It takes an input and returns an output.
-
Example of function: console.log(5*5)
-
A side effect is what happens if there is a change in the internal state of the machine in a way that will affect statements that come after it.
-
Side effect function: prompt(âEnter passwordâ);
Value producing function: console.log(Math.max(2,4)); -
Control flow is the order in which the computer executes statements in a script.
-
Conditional executions perform different computations or actions depending on whether a programmer-defined boolean condition evaluates to true or false.
-
Keywords used to invoke conditional execution: if, else, switch, while, loop
- A fragment of code that produces a value is an expression.
- A binding or a variable takes an expression and gives it an assignment.
- 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.
- prompt() is a function call to a dialog box.
- A side effect of the prompt() function would be the dialog box that appears. A side effect doesnât return a value but allows the function to operate.
- prompt() produces a side effect, Math.max() produces a value
- Control flow describes the execution of statements within the program.
- Conditional execution uses a value in order to decide what to do next in the control flow.
- A conditional statement can be executed by the keyword if.
-
An expression is any fragment of code that produces a value.
-
A binding is the same as a variable. This lets you define a piece of data that can be stored.
-
The environment is a collection of all the bindings and the values that exist. Even in an empty program there are bindings from the language itself.
-
A function is snippets of code that wrap a program. It can be as simple or complex as the developer writes it.
-
let x = B(4, 3);
function B(a, b) {
return a * b;
} -
A dialog box or written text can be examples of a side effect.
-
Side Effect creates a dialog box for the answer: let a = ((4*2)>3)&&((6-3)>20);
alert(a);
Value: console.log(Math.max(2, 4)); -
Is a program with more than one statement. The code is initiated top to bottom the same as a book.
-
This is called upon if the developer wants to curve away from a straight line program. Loops can split the program but bring it back to the ending.
-
These can be made by if, else, if and only if, while, and do.
- Expression is a fragment of code that produces a value.
- Bindings are used to catch and hold values.
- The environment is the collection of binding and values at a certain time.
4./5. A function is a piece of a program in the default environment. Examples of functions are console.log, prompt. - Side effects are often produced by functions and they can be very useful.
- For example, prompt function shows a dialog box. A function that produces value can be math.max.
- Control flow is when a program contains more than one statement and they are executed from top to bottom.
9./10. Conditional execution is best shown with the keyword IF, when we want our program to do something if and only if something else is satisfied.
-
What is an expression?
it is Javascript equivalent of a sentence fraction in human language. -
What is a binding?
It is a way to catch and hold values. In other words, it means that if you want to define certain things with values, you have to bind them. -
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.
console.log function -
What is a side effect?
Showing a dialogue box or writing text to the screen is a side effect.
A side effect is any application state change that is observable outside the called function other than the return value. -
Give an example of a function that produces a side effect and another function that produces a value.
-
What is control flow?
The order in which statements are executed. -
What is conditional execution?
Executions on predefined conditions. If keyword is used. -
What kind of keyword do you need to use to invoke conditional execution?
If
An expression is a fragment of code that represents a value
A binding is a variable that programs an expression to hold a specific value consistently
An environment is the collection of expressions and their functions which create a context for interaction with the language
A function is programming tied to specific values to create the default environment
An example of a default function would be the programming of the variable âpromptâ to provide an input form in a web browser environment
A side effect is one of the possible results of a function
The input form field would be an example of a side effect of the âpromptâ default web browser function, but another result of a function besides a side effect could be the simple return of a value
The control flow allows the code to read as a logical, sequential language by taking the top statement and continuing to build or alter it depending on the subsequent statements
Conditional execution is when a statement is given that asks for more than one possible function depending on circumstances
Conditional executions can be programmed by adding statements with keywords like âifâ after statements with keywords like âletâ
- Anything that goes down to a value identity and breakdowns problems into smallest pieces possible, solve little problems.
- Binding (variable) maintains an internal state within a program, that stores value for utilization later on.
- The collection of bindings and their values that exist at a given time.
- A function is a wrapped section that performs a specific task
- console.log(""), is a function which outputs some information to the console.
- Side Effect is a function which produces an expression and returns value. Showing a dialog box or writing text to the screen. A change
- prompt(âEnter passcodeâ); [side effect] and console.log(Math.max(2,4)); produces no side effect, through produces a value.
- Order of executing code from top to bottom left to right.
- using a logical operator determine whether or not to execute certain parts of the code.
- if, else
- Any code that generate a value is an expression.
- Binding (var) is a code that bind to some information and store in the computer memory.
- An environment is all of the bindings that have been made within a program.
- A piece of program that wrap in a value that perform specific task.
- alert(âIâm Ironman, youâre ironing manâ)
- Functions/statements that modify states outsides its scope. (changing the world environment/internal state)
- Side effect: alert(âWatch Out!â)
Returning value: console.log(6*9) - The program flow is read from top to bottom, statements & functions are executed from top to bottom as well.
- Conditional execution is a branching road, this is to execute a code if certain requirement or conditions were met.
- Keyword: if
- What is an expression?
Code that resolves to a value - What is a binding?
A variable is a named piece of computer memory that contains data. - What is an environment?
A 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.
In a browser environment, the binding prompt holds a function that shows a little dialog box asking for
user input. - What is a side effect?
A statement or function that affects something else which it is not meant to. - Give an example of a function that produces a side effect and another function that produces a value.
- What is control flow?
The order that we code in - What is conditional execution?
Where the program adapts to the situation at hand. - What kind of keyword do you need to use to invoke conditional execution?
If
- An expression is a piece of code that produces a value.
- A binding is the attachment of a variable to a value.
- An environment is the total of variables, bindings and the attached values at given time, which are contained in the computers memory.
- A function is a piece of program wrapped in a value.
- the prompt(âsomethingâ) function crates a dialog window that says âsomethingâ.
- A side effect is the output of a function that affects the screen, it is usually a dialog box or writing text.
7.Here is an example of a function that produces a side effect: prompt(âENTER NAMEâ);
Here is an example of a function that produces a value: console.log(Math.max(2,4)); - Control flow is the order in which statements are executed in a script.
- Conditional execution is a branching of the control flow , usually initiated by the keyword âifâ which results in the computer checking whether or not the conditions, that were set by the programmer, are met before executing the function that follows after the " if (condition) " statement.
- You use the the âifâ keyword followed by the condition , which is stated inside parenthesis, if the condition is met the program proceeds to execute what is in the curly backets {} , if the condition is not met you can add the keywords " else if" after the brackets to make the program check for another condition, which again is followed by curly brackets {} , the content of these curly brackets is then executed if the conditions are met.
- 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 the sentence is going to define binding. It is followed by the name of the binding and if we want to immediately give it a value, by an = operator and expression. - What is an environment?
The collection of bindings and their values that exist at a given time is called environment. - What is a function?
A lot of the values provided in the default environment have the type function. A function is a piece of a program wrapped in a value. - Give an example of a function.
prompt (âEnter passcodeâ) - What is a side effect?
A statement stands on its own, so it amounts to something only if it affects the world. 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 the statements that come after it. These changes are called side effects. - Give an example of a function that produces a side effect and another function that produces a value.
- What is conditional execution?
Conditional execution is created with the if keyword in JavaScript.
FYI, some of the questions I could not find the answers.
- A fragment of code that produces a value.
- It is a statement that allows JavaScript to catch and hold values.
- The collection of bindings and their values that exist at a given time.
- A piece of program wrapped in a value.
- promp(âEnter passwordâ);
- Showing a dialogue box or writing text.
- Function that produces a side effect: console.log(âHello!â);
Function that produces a value: console.log(Math.max(2,4)); - When your program contains more than one statement, the statements are executed as if they are a story, from top to bottom.
- A branching road, where the program takes the proper branch based on the situation at hand.
-
if keyword -> we want some code to be executed if, and only if, a certain condition is met
Can also use the else keyword, together with if, to create two separate, alternative execution paths.
-
What is an expression?
a fragment of code that produces a value -
What is a binding?
defining a variable -
What is an environment?
the collection of bindings and their existing values -
What is a function?
a piece of program wrapped in a value -
Give an example of a function.
displaying a message when a web page loads (alert) -
What is a side effect?
showing a dialog box or a text output -
Give an example of a function that produces a side effect and another function that produces a value.
console.log("Hello, world!) - side effect
Math.max(2,3,44) - value -
What is control flow?
the order in which multiple statements in a program are executed: top to bottom -
What is conditional execution?
a non-straight, branching control flow created with the if keyword -
What kind of keyword do you need to use to invoke conditional execution?
IF