- A fragment of code that produces a valueor a value that is written literally in parenteses
- A binding remembers and holds values. An operator can change the value of a binding
- Environment is a collection of bindings and their values
- Function is a programme wrapped in a value
- prompt(“Enter your name”);
- Side effect is a return value eg a dialog box
- Function eg that produces a side effect - prompt(“Enter your name”); console.log(Math.max(2, 4)); prouces a value of 4
- Control flow - statements are executed like a story from top to bottom
- Conditional execution - where a programme takes a certain direction based on a situation
- keyword - IF
-
What is an expression?
An expression is a fragment of code that produces a value. An expression can contain other expressions and/or operators. -
What is a binding?
A binding is a variable used to catch and hold values, done using a name preceded by the keyword let . -
What is an environment?
Environment refers to the collection of bindings and their values, that exist at a given time. -
What is a function?
A function is a piece of a program wrapped in a value, that can be applied in order to run the wrapped program. - Give an example of a function.
function myFunction(p1, p2) {
return p1 * p2;
// The function returns the product of p1 and p2
}
-
What is a side effect?
A side effect happens when a statement of function changes 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.
prompt(“Enter passcode”);
produces a side effect
console.log(2+8);
produces a value.
-
What is control flow?
Control flow refers to the way the computer executes the statements in a script. -
What is conditional execution?
Conditional execution refers to the possibility to manipulate the control flow of a script depending on the values of the expressions. -
What kind of keyword do you need to use to invoke conditional execution?
The keyword if is used to decide what is executed.
1.An expression is a fragment of code that produces a value. An expression can simply be !true; or (14 and 31).
2.A binding is the process of holding a value.
3.An environment is having a collection of binding and their values.
4.A function is a block of code designed to perform a particular task.
5.An example of a function is let x = myFunction(4, 3);
6.A side effect is having a function alter the external state of an application. A function can alter parts or values of your application which don’t directly reside within that application.
7.An example of a function that produces a side effect is function pluswithsideEffects(x,y) { alert(“This is a side effect”); return x + y; }
An example of a function that produces a value is
function myFunction(a, b) {
return a * b;
}
8.Control flow is known as directing the flow of code that is provided to an application.
9.It is referred to as the ability to execute code depending on some particular condition.
10.An example of a keyword could be if( ) to be used to invoke conditional execution.
- Expressions are a fragments of code, that produce values.
- Binding or variable catches and holds values. It uses the special word “let”. Previously, before 2015 the word var was used instead of let. These words are known as keywords, which are then followed by the name by which the binding will be called.
- The environment is a collection of bindings(variables) and their values.
- Function is a piece of program, wrapped in a value. It becomes an object, ready to be used as many times as needed. It reminds me of a term “block”, known in designing software such as autocad and others. A block contains a drawing, which is drawn only once, and then pasted whenever needed inside a project. A block, similar as function, can be later edited, which applies to all the copies.
- An example is function “prompt”, which is a dialog box. It can be added as a value, whenever needed.
- Statement, that makes something happen, in other word it “changes the world”, has a side effect. Otherwise it has a meaning just to itself.
- Side effect: console.log
Value: Math.max, Max.min - Lines of code are executed consecutively from top to bottom, like a story. That is a control flow.
- Conditional execution means, that when the program reaches a certain point of a “story”, where two or more different “unfoldings” are possible, a certain condition decides which predetermined path will it take.
- I know two of them, if and else.
-
What is an expression?
A piece of code that results in a value. Eg v+z=5,
var y = get answer ();
Every value written is also an expression. eg 5 is an expression.
an expression between 2 parenthesis () is also and expression eg get answer above (a call to function that results in a value)
An expression is also a binary operator applied to two expressions or a urinary operartor applies to one expression. -
What is a binding?
A binding is is used to catch and hold values so they dont dissipate. Bindings are like tentacles, rather than boxes. A Binding does not contain values; it grasps values—two bindings can refer to the same value. A program can access only the values that it still has a reference to. When you need to remember something, you grow a tentacle to hold on to it or you reattach one of your existing tentacles to it.
example:
let caught = 5*5
Let is a key word followed by caught which is the binding followed by the operator =, then the value=5x5
Bindings are declared using var or const. -
What is an environment?
An environment is a collection of bindings and their values that exist at a given time . For example the browser environment is not empty but contains bindings that are part of the Language Statements as well as bindings that provide ways to interact.a website loading and my keyboard interaction with the browser are sample bindings in the background for search function. -
What is a function?
A function is a piece of program wrapped in a value . The values are mostly found in a default environment and such values are applied to run a wrapped program -
Give an example of a function.
A binding prompt holds a function that shows a dialogue box that shows a way for the user input eg sign up dialogue box or enter pass code prompt. prompt (“enter passcode”); -
What is a side effect?
A side effect is any application state change that is observable outside the called function other than its return value. -
Give an example of a function that produces a side effect and another function that produces a value.
Side effects include: Modifying any external variable or object property (e.g., a global variable, or a variable in the parent function scope chain) Logging to the console. Writing to the screen.
Side effect: prompt (“Enter passcode”);
Value: Math .max(2, 4); -
What is control flow?
control flow is the order in which we code and have our statements evaluated, It is the direction of execution of code in a top down approach -
What is conditional execution?
Conditional execution is a branch in the control flow execution where the program takes a proper branch based on the situation at hand. Conditional execution is created with the *** if *** key -
“If” statements: where if a condition is true it is used to specify execution for a block of code.
-
What kind of keyword do you need to use to invoke conditional execution? if , let
Else” statements: where if the same condition is false it specifies the execution for a block of code.
Else if” statements: this specifies a new test if the first condition is false.
- An expression is a fragment of code.
- A binding is like a tentacle that groups and holds on to values, the program to access these values.
3…An environment is a collection of bindings and their respective values as of a time. - A function is wrapped program with defined values.
- Console.log function.
- A side effect is showing a dialog box or writing text to the screen.
- The Alert function produces a side effect and Math.max function produces a value.
- Control flow refers to the flow of program statements execution, depending on how the program statements created.
- Conditional execution refers to branching execution roads within a program, the branching execution is based upon meeting certain conditions.
- The ‘If’ keyword and the ‘else’ keyword.
- What is an expression? A fragment of code that produces a value.
- What is a binding? It´s the way JS catches and holds values. After a binding has been defined, its name can be used as an expression.
- 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.
prompt("Enter passcode");
- What is a side effect? Showing a dialog box or writing text to the screen is a side effect. Only producing a value is not.
-
Give an example of a function that produces a side effect and another function that produces a value.
Side effect:prompt("Enter passcode");
Value:Math.max(2, 4);
- What is control flow? It´s the way programs execute their statements, from top to bottom as if they were a story.
- What is conditional execution? It’s the way by which some statements in our program are executed only when some predefined conditions are met.
-
What kind of keyword do you need to use to invoke conditional execution?
if
andelse
-
What is an expression?
A part of a code that generates a value. -
What is a binding?
A binding is a function that basically allows you to catch and hold a value. -
What is an environment?
An environment is a collection of bindings and their values at a given time -
What is a function?
A function is a value that executes a program -
Give an example of a function.
let favFood = “Burger”
undefined
console.log (favFood + " " + “one”)
Burger one -
What is a side effect?
A side effect is when a function produces a dialogue box, or a box to write text. -
Give an example of a function that produces a side effect and another function that produces a value.
prompt (“What is your name?”) – produces a side effect
console.log (22)* – Produces a value -
What is control flow?
Control flow is the order by which functions are executed, from top to bottom. -
What is conditional execution?
Conditional execution is when the functions may execute differently based on whether a condition is met. -
What kind of keyword do you need to use to invoke conditional execution?
if and else
1
It is an expression that will return a value.
2
Binding is naming a value so you can link to it later like tentitcalss you can retrieve it later
3
An environment is all the binding that have been created in the program
4
a pice of programming wrapped in a value
5
prompt (“Enter you email”);
6 Something a function will produce like showing a dialog box or writing text
7
enter password produces a side effect
math.max(1,2); for a value
8
from top to bottom, in the correct order
9
conditional execution works as the code checks to ensure that the conditions have been met before moving to the next line of code if it is not met it will stop or go in a loop
10
If is the keyword
- What is an expression?
“A fragment of code that produces a value”
- What is a binding?
Bindings or variables are ways to set and hold values.
- 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.
function deposit() public payable returns (uint) {
balance[msg.sender] += msg.value;
emit depositDone(msg.value, msg.sender);
return balance[msg.sender];
}
- What is a side effect?
A return resulting from the function ?
- Give an example of a function that produces a side effect and another function that produces a value.
“console.log(Math.min(2, 4) + 100);
// → 102”
- What is control flow?
The order in which statements are executed in a program.
- What is conditional execution?
A fork in the road, execute this if this happens, else execute that if that happens… (or do not execute at all).
- What kind of keyword do you need to use to invoke conditional execution?
if - else
-
What is an expression?
(2/3) -
What is a binding?
e.g. let binding = “a string”; -
What is an environment?
a scope of the code in which bindings refer to values -
What is a function?
a fonction is the core of a program: it does operations with values and returns values -
Give an example of a function.
Number(prompt(“type 10”); -
What is a side effect?
a change in the program that is shown in the thereafter statements -
Give an example of a function that produces a side effect and another function that produces a value.
side effect: e.g. let Function1 = Number(prompt(“enter a number”)); alert(String(Function1));
- What is control flow?
The order of executing the different parts of the program
- What is conditional execution?
you can recognize when “if” occurs in the code and thereafter the block to be executed between curly brackets; or “if … else” statement
- What kind of keyword do you need to use to invoke conditional execution?
if , or “if … else” or a you can “chain” the if’s and the else’s
-
An expression is a piece of (fragment) of code that produces a value. An expression can be thought of as a painting, where the value is the substance or emotion produced when viewing the image. Expressions can be layered images that create depth within itself.
-
Binding is like throwing a leash on your dog but its when we tie a value or expression to a defining word or set of characters. Yet it also goes further with how it “catches”(caught) the result(or value) of the expression it is binding
*Within the binding you have the face(identifier)but that’s used as a sort of container and then you have the resulting values that do the work when the identifier is called upon. Like how when you bake a cake. You have a pan that is your container. You mix up you ingredients and throw it in the oven to cook, this being the expressions. And if you got it right you end up with a treat to fill the belly. so the binding is like tying the pan to the process of baking a cake. the result from the binding plays out the process and your satisfied sweet tooth is the result that moves on to face the rest of the day. Even though the binding is between the pan and process… what you get is the result in short. and the binding process is initiated with lines like var, let, and const. -
Environment is the current state of relations between values, expressions, functions, through bindings. Kind of like when build crazy pillow forts as a kid and it is never exactly the same twice. Well the pillow placement, the sheets, the couches, what is the door, where you attack from, how you defend… can all be seen as the environment of your fort. Well the binding of values and expressions create a sort of language that is being used by the programmer to create the environment that builds such a fort… but through code.
-
A function is a code that runs dependent on values in order to cycle its purpose within a program
-
I think an example of a function with which everyone should be aware of at this point in time would just be the simple alert. Also log in credentials i figure would classify as a function as well.
-
Side-effects are changes that occur in an environment that have reaching effects outside of the designated assignment.
-
? would sha-256 be considered a function that creates just a value??? Now from my understanding a function that just produces values would be like how a tax program will take your inputs and give you just static results that have no purpose other than information. And a function that may effect other functions and their characteristics could be like log in credential functions that have security levels for different inputs (or credentials) that open up more or less door so to speak. Now if your asking for me to write the code for a function like these… I’ll have to do some research because I’m just a noob in here trying to hang on.
-
Central flow is the term used to describe the way inputs, expressions, functions are carried out in the programming language. Kind of like the arrow of time but not constricted to just a straight line. Java script works left to right and top to bottom. This is the path that the code is read when initiated. Kind of like when we read a book.
-
Conditional Execution is when the general central flow can be somewhat different based on sometimes requiring a “jump” or “skip” to a specific branch of the programming due to the nature of an imputed situation.
-
Well I know that the keyword “if” begins the conditional execution and “else” is a supporting keyword in the matter along with a Boolean expression in order to determine path. Yet in regards to the type of keyword,… Honestly i figure it would fall under the Boolean type due to the conditional execution it invokes.
… to those that read this,… I’ve skimmed the answers of others after typing this all out and realize I may have been a bit off on some. I am open to being guided. This is very difficult for me to learn so far. It is requiring me to change the way I think and interpret the relations of things.
- Code that generates a value.
- Bindings are used to catch and hold values.
- A collection of bindings and their values that exist at a given time.
- Function is a piece of program wrapped in a value (quoting direclty).
- prompt(“Enter your Age”)
- A side effect is the display of a dialog box or written text to the screen.
- Console.log(Math.max(2, 4)) and Console.log(Math.max(2,4)+100)
- Control flow describes the need of values at the top for code at the bottom to be executed.
- The order by which the program execute statements depends in some conditions.
- If, else.
- What is an expression?
A fragrant of code that produces a value.
- What is a binding?
A location in memory to store a value called a variable
- What is an environment?
An environment is the “run-time environment” that provides language specific built-in functionality in order to interact with the program or other systems while running. Example, taking advantage of the mouse click to have JS do something or interacting directly with the HTML of a webpage through document.body and so on ….
- What is a function?
Predefined and re-executable code that results in a value and possibly side effects.
- Give an example of a function.
prompt(), alert(), and others built into the language or programmer defined functions.
- What is a side effect?
A statement of code that impacts the statements and values that follow. It could effects that occur within the code or related to visual changes in the UI such as graphical or informational such as a prompt trigged by a click or page load.
- Give an example of a function that produces a side effect and another function that produces a value.
The alert prompt is an example of a side affect since it takes in data from a hard coded value or a binding to produce a message.
Math.pow() is an example of a function that provides a value, which would be the result of an exponent. On its own, this is all it does. It will not impact any surrounding code on its own.
- What is control flow?
The order in which a program runs. A program will run and execute line by line until it reaches the end or another event triggers the program to terminate.
- What is conditional execution?
Conditional execution in a program takes place when there is a deciding factor on which code to execute out of 2 or more possibilities, triggered by boolean statements or values.
- What kind of keyword do you need to use to invoke conditional execution?
True/False in an if, else if, while, do while
- A fragment of code that produces a value.
- A kind of statement that catches and holds values.
- The collection of bindings and their values that exist at certain time.
- A piece of program wrapped in a value.
- In a browser environment a binding called prompt holds a value that has a function that shows a dialog box asking for users input.
- In the example above (with the prompt), side effect is the dialog box that pops up.
- Prompt produces side effect, console.log produces value.
- It is a way that statements are executed and it goes from top to bottom (like you would normally read a story).
- Sometimes statements don’t just get executed simply from top to bottom but instead we have branching roads which means that the program will take the proper branch depending on the situation at that moment.
- if
-
What is an expression?
They are fragments of code (Values or “expressions”). These are then used to build ‘Statements’ that prat of building useable, functional programs -
What is a binding?
Linking or holding a value for later use without changing the original value -
What is an environment?
It is where the bindings and functions exist when you start an editor or console -
What is a function?
It is a piece of programming that already exists, you can then call upon or apply that function -
Give an example of a function.
The example given is a prompt dialogue box or the alert function -
What is a side effect?
A function that calls on the user to interact with the program -
Give an example of a function that produces a side effect and another function that produces a value.
A dialogue box appearing is an example of a side effect, Functions that show values are sum, average, median -
What is control flow?
The order you want statements executed -
What is conditional execution?
You functions or expressions will be executed only IF certain conditions hold -
What kind of keyword do you need to use to invoke conditional execution?
If, Else
1. What is an expression?
A fragment of code that produces a value.
2. What is a binding?
A binding is synonymous with a variable that is used to grasp/catch and hold values for later use in an expression.
3. What is an environment?
An 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.
prompt(“Enter passcode”);
6. What is a side effect?
A side effect is a change in the internal state of the machine that will affect the statements that come after it.
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 is a dialog box or writing text to the screen.
An example of a function that produces a value is: Math.max takes any amount of number arguments and gives back the greatest.
8. What is control flow?
Control Flow is used when your 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?
Conditional Execution is the creation of a branching road, where the program takes the proper branch based on the situation at hand
10. What kind of keyword do you need to use to invoke conditional execution?
When the “if” keyword is used.
- An expression is a fragment of a code that produces a value.
- A binding is used in javascript to catch and hold values.
- The collection of bindings and their values that exist at a given time are known as the environment.
- A function is a piece of program wrapped in a value. Such values can be applied in order to run a wrapped program.
5.‘console.log’ - A side effect is where a function produces a dialogue box or text to the screen automatically even if that’s not the direct cause for the function.
- prompt(‘enter passcode’); --> will produce a dialogue box
console.log (math.max(2,4)); output a value of 4 - When the program runs multiple statements they are executed from top to bottom similar to a story
- Not all programs take straight-line control flow. We may, want to create a branching road, where the program takes the proper branch based on the situation at hand or condition that we give it. This is called conditional execution. Conditional execution is achieved with the if and else keywords.
- Key word can be ‘if’
Do not worry. We are here to support you throughout your learning journey. Hang in there, you will soon be at awe on how far you’ve come in the coming weeks. Good luck with your studies!
- An Expression is a fragment of code that produces a value.
- A Binding is to catch or hold values, without a binding the new value will dissipate again. let, var or const are bindings.
- The collection of bindings and their values that exist at a given time is called
the environment. When a program starts up, this environment is not empty. It
always contains bindings that are part of the language standard, and most of the
time, it also has bindings that provide ways to interact with the surrounding
system. - A function is a piece of program wrapped in a value. Such values can be applied
in order to run the wrapped program. - prompt(“Enter passcode”);
For example, in a browser environment,
the binding prompt holds a function that shows a little dialog box asking for
user input. - Side Effects are statements that affect the statements that
come after it. - prompt(“Enter Password”);
Math.max(2, 4); - Control Flow is the order of executing your code, when you have more than one statement. Straight-line control flow from Top to button.
- Conditional Execution, where the program takes the proper branch based on the situation at hand.
- If() is the keyword.