- A fragment of code that produces a value.
- A keyword that catches values.
3.The collection of bindings and their values that exist at a given time. - A piece of program wrapped in a value
- Example: prompt(“Enter passcode”);
- Showing a dialog box or writing text to the screen.
-
- Ex. of function that produces a side effect : prompt(“Enter you name here”);
- Ex. of function that produces a value : console.log(Math.min(50, 100) + 600)
- When your program contains more than one statement, andthe statements are
executed as if they are a story, from top to bottom. - A program that is a branching road, where the program takes the proper branch based on the
situation at hand. - if, else, else if
- ***What is an expression?
A piece of value that produces a value. - ***What is a binding?
These are like tentacles that grab a value, and they are not permanent as you can let go of them by entering “=” - ***What is an environment?
A collections of bindings and their values at a given time. - ***What is a function?
A piece of program wrapped in a value which can be ran by applying it. - ***Give an example of a function.
The console.log function. - ***What is a side effect?
When a dialog box or writing appears on the screen. - **Give an example of a function that produces a side effect and another function that produces a value.
Side effect: prompt(“Whats” your favourite colour?");
Value: Console.log(83); - ***What is control flow?
The order in which the statements are ran, from top to bottom. - ***What is conditional execution?
The process that a code is executed only if a certain condition has been met. - ***What kind of keyword do you need to use to invoke conditional execution?
If.
-
a fragment of code that produces a value, Every value that is written literally, An expression between parentheses, a binary operator between expressions, or a unary operator are examples of expressions.
-
A binding is a statement that catches and holds values.
-
An environment is a collection of bindings and their values.
4.A function is a piece of function wrapped in a value.
- An example of a function- function Hello(){
alert( “Hello World!”);
}. - Showing a Dialog box or writing text to the screen are examples of side effects.
7.function Hello(){
alert( “Hello World!”);
}- produces a side effect.
console.log("Hello World!)- produces a value
-
When your program contains more than one statement, the statements are executed from top to bottom. Control Flow
-
A conditional execution is when you the program can take multiple paths based on the situation at hand. Much like logic operators.
-
if and else are examples of keywords needed to invoke a conditional execution.
1.expression is a fragment of code that produces a value.
2.binding is a way for the program to catch and hold values
3.environment is the collection of bindings and their values that exist at a given time.
4.a function is a piece of program wrapped in a value.
5.In a browser environment the binding prompt holds a function that shows a little dialog box asked for user input.
6.Showing a dialog box or writing text to the screen is a side effect.
7.math.max, math.min
8.When a program contain more than one statement , the statements are executed as if they are a story ,from top to bottom.
9. if we want to create a branching road, where the program takes the proper branch based on the situation at hand.
10.the word “if”
1 What is an expression? an expression is a fragment of code that produces a value
2 What is a binding? a binding catches or holds a value
3 What is an environment? an environment is a collection of keywors, bindings, functions and values
4 What is a function? a function is a fragment of code that produces a value
5 Give an example of a function. prompt
6 What is a side effect? a side effect is code that changes the remainder of the program or causes an external action
7 Give an example of a function that produces a side effect and another function that produces a value. writing text to the screen (print) or producing a dialog box (prompt)
8 What is control flow? control flow is the direction in which to program is executed usually from top to bottom
9 What is conditional execution? conditional execution interrupts straight line flow and causes a branch or loop
10 What kind of keyword do you need to use to invoke conditional execution? if, while, do, else may cause a branch in straight line flow
1 A fragment of code that generates a value
2. A variable, designed to define and hold values
3. All the bindings and their respective values that exist at a given time
4. A programming command that’s defined or wrapped in a value
5. alert(“keep learning!”);
6. A pop-up dialog box or writing text to the screen
7. alert (“I’m a side effect”);
function boom(a, b, c, d=9){return (a+b)/c+d;}
boom(4, 5, 3);
–> 12
8. A set of statements that are executed in order
9. A branching set of executions where the workflow will follow based on the situation
10. “if”
- What is an expression?
returns a value - What is a binding?
The bind () method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - What is an environment?
all the bindings and values - What is a function?
A function can be defined using function keyword and can be executed using () operator. - Give an example of a function.
alert console.log prompt - What is a side effect?
change the internal state the affect what comes after - Give an example of a function that produces a side effect and another function that produces a value.
Math.max(2,4);
Produces the value 4. - What is control flow?
When the code consists of more than one statement, the code is executed from top to bottom. - What is conditional execution?
Branching the controll flow of a programm based on a specific condition represents a conditional execution - What kind of keyword do you need to use to invoke conditional execution?
If
- A piece of code that represents the simplest part of an statement.
- It is a piece of code that stores expressions, statements, objects.
- The type of language standard in a program.
- It is a piece of program that a value holds.
- Math.max
- Changes that the statements produce either in the software interface or inside the machine.
- Value: a + b = z; Side Effect: prompt(“Winter is coming”)
- Is the way that a program reads the statements from the top to the bottom.
- When you want to create a branch on the control flow according to what the user answers.
- If and else
- What is an expression?
a fragment of code that produces a value - What is a binding?
binding or variable is a way to catch and hold 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.
the binding “prompt” holds a function that shows a little dialog box asking for user input - What is a side effect?
the return values - 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)) with side effect: 4
value: console.log(Math.min(2, 4) + 100) with value 102 - What is control flow?
when the program has more than one statement then they are executed from top to bottom - What is conditional execution?
choosing the proper branch based on the situation - What kind of keyword do you need to use to invoke conditional execution?
“if” and “else”
-
What is an expression?
An expression is a piece of code that returns a value. -
What is a binding?
binding is a way to connect tags to a value that can be used later as an expression, in javascript is used let function. -
What is an environment?
An environment is a colection of bindings and values in any given time. -
What is a function?
A function is a piece of code that we can name and it takes an input does some internal calculations and returns the result. -
Give an example of a function.
function Result(a, b) {
return a * b;
} -
What is a side effect?
Side effect is when using the console, our code prompts the browser to print a sentence or open a dialog box. -
Give an example of a function that produces a side effect and another function that produces a value.
Function that produce side effect : prompt(),
value function total(a+b){
let a=5,b=2;
return a+b;
}
-
What is control flow?
flow is the sequenced execution of commands from right to left and top to bottom. -
What is conditional execution?
Conditional execution is when the program gets to choose wich direction of the program to take (based on the calculations or inputs). -
What kind of keyword do you need to use to invoke conditional execution?
We use the “if” keyword
- What is an expression? A fragment of code that produces a value.
- What is a binding? A binding, or variable, is used to catch and hold values.
- What is an environment? The collection of bindings and their values that exist at any given time.
- What is a function? A piece of a program that is wrapped in a value.
- Give an example of a function. A prompt function, which prompts the user to input information, etc.
- What is a side effect? A side effect is the action that a function takes within a program.
- Give an example of a function that produces a side effect and another function that produces a value. A functiont hat produces a value is console.log(Math.max(2, 4)); while a funtion that produces a side effect could be prompt(“Enter Passcode”);
- What is control flow? The order in which the statements in your program are executed.
- What is conditional execution? When the action that a program takes is conditional on a previous function’s output.
- What kind of keyword do you need to use to invoke conditional execution? You’d use the “if” keyword to do this, which executes or skips a statement depending on the value of a Boolean expression. The deciding expression is written after the keyword, between parenthesis, followed by the statement to execute.
-
A fragment of code that produces a value
-
Binding is catching and saving values
-
An environment are the collections of bindings and their given values
-
A function is a piece of program wrapped in a value
-
Prompt (“write passcode”)
-
Side effects are statements that can change the world (so to say) or change the internal state of the machine.
-
Alert(“hallo world”) console.log(Math.max(2, 4))
-
The control flow is how the program reads the so called story
-
Only let something happen if certain criteria are met
-
With the word if
- Expressions are fragment of code that produces a value.
- Binding is used to catch and hold values.
- Environment are the collection of bindings and their values that exist at a given time.
- A function is a piece of program wrapped in a value.
- prompt(“Enter passcode”);
- Showing a dialog box or writing text to the screen is a side effect.
- A function that produces a side effect is prompt and a function that produces a value is console.log.
- When your program contains more than one statement, the statements are
executed as if they are a story, from top to bottom. Control Flow is the order on which it gets executed. - 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. - Conditional execution is created with the if keyword in JavaScript.
- An expression is code that reduces to a value
- A binding is a tag of code that represents some value or object
- The collection of bindings and values
- A piece of program wrapped in a value
- prompt()
- Showing a dialog box or writing text to the screen
- side effect
prompt()
value
math.max() - Control flow is the execution of code from top to bottom
- Conditional execution is when the control flow has multiple branches based on the outcome of operations
- if
Any fragment of code that produces a value is called an expression.
Bindings are tags with a name that are assigned to values so that these values do not get deleted and can be called at other points of the code.
An environment is the collection of all the values that exist at a given time.
A function is a value that contains a piece of code. for example, “console.log()” is the value which calls a function that logs the given argument to the screen.
Any other action done by a function besides returning a value is a side effect. So, “console.log()” produces a side effect. a function that produces a value would be “math.min(2, 2)”.
Control flow is the order in which statements are executed in a program.
Conditional execution is a piece of code that gets executed only when a condition holds. For this, we use the word IF in Javascript.
- What is an expression? Is a piece of code that produces a value (it can contain nested expressions to build more complex computations) A expression corresponds to a full sentence. A program is a list of statements.
If an expression corresponds to a sentence fragment, a JavaScript statement corresponds to a full sentence. A program is a list of statements.
- What is a binding? Are used to catch values so they dont dissipate, and use them. Is made up a keywork “let”, the name of the variable, = operator and an expression. After a binding is defined, it can be used as an expression.
The value can be later disconnected and assigned a new one.
- An empty binding is = Undefined
- A single let statement may define multiple bindings (commas)
- Let, var and const can be used to create bindings.
- Names must not start with a digit, punctuation or special characters, or special reserved words
- What is an environment? Collections of bindings and their values that exist at a given time.
- What is a function? Piece of a program wrapped in a value.
- Executing a function is called invoking, calling or applying.
- Values given to functions are called arguments and different functions might need different types of arguments.
- Give an example of a function.
let ten = 10;
console.log (ten * ten);
// 100
- What is a side effect? producing an actions like showing a popup in the screen is a side effect and is what makes a function useful. They can as well produce a value in which case they don’t need to have a side effect to be useful.
- 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 execution of more than one statement from top to bottom like a story.
- What is conditional execution? When a program take a path depending on the situation at hand. If we want a code to be executed if certain conditions are met.
- What kind of keyword do you need to use to invoke conditional execution? The keyword is if, to handle an alternative path we use the keyword else. If/else are used to chain conditional together.
1: A fragment of code that produces value is called an Expression.
2: To catch and hold a value in JavaScript a Binding is created. It is also known as a Variable (or Constant) and once created can be used in expressions.
3: All of the Bindings and their values that exist at a given time is called the Environment.
4: A Function is a program that is wrapped inside a value.
5: A side effect is something other than a Value returned by a function.
7: The prompt binding hold a function that results in the creation of a text box on screen prompt, whereas a function to add two integers together will only do that.
8: Control Flow is the way that the story of the program is told…the way the statements of the code are laid out determines this.
9: A conditional execution uses the word IF to excute the code only if certain conditions are met.
10: If, else
- An expression is a fragment of code that produces a value.
- A binding is essentially a variable, used to catch and hold value.
- A collection of variables or bindings that exist at a given time are the environment.
- A function is a piece of program wrapped in a value.
- An example of a function would be "function addObjectPropert(obj1,key,obj2) {
obj1[key]=obj2;
} - Side effects are changes to the values of the code.
- let mood = “light”;
console.log(mood);
// → light
mood = “dark”;
console.log(mood);
// → dark
The function above^^ produces a side effect because the let mood changed from light to dark.
function addTwoNumbers(2,5) {
(2+5);
return (7);
}
The function above ^^ produces a value of 7 by adding 2 and 5 together. - A control flow is when your code acts as a story, where code is executed one-by-one.
- Conditional execution is when code is executed via an if statement.
- You invoke the “if” keyword to execute a conditional statement.
- and fragment of code.
- hold a value to a specific variable
- bindings and their values in a specific moment.
4.a piece of a programme with a valued - prompt (what is your name)
- the impact of a function.
7.prompt give side effect Math.max give value - code that happen linearly.
- branched flow coding depending on condition
- if else
-
What is an expression?
An expression is any unit of code that can be evaluated and resolved to a value. -
What is a binding?
A binding is a logical connection between two objects. -
What is an environment?
An environment is the collection of bindings and their values at any one time in a system. -
What is a function?
A function is a piece of program code wrapped in (bound to) a value. -
Give an example of a function.
prompt(“Welcome to my page”); -
What is a side effect?
A side effect is a change of state in the program environment after a function is called. -
Give an example of a function that produces a side effect and another function that produces a value.
The following let function binds x to 1 with the side effect of x temporarily being bound to one:
let x = 1;
The next function calls forth the value of x previously assigned to it without changing the internal state of the system:
console.log(x); -
What is control flow?
Control flow is the order in which statements are executed by the computer. -
What is conditional execution?
Conditional execution is changes the output of an instruction depending on the input. Conditional execution involves the use of the “if” keyword and often the “else” keyword and “else if” combo. -
What kind of keyword do you need to use to invoke conditional execution?
If.