- Expression is when you are interacting values with operators, the whole proces including the result is called expression.
- Javascript provides that thing biding to be able catch and hold values.
- Environment is the collection of bidings and there values at given time.
- Function is piece of program wrapped din value.
- console.log; prompt; Math.max; Math.min …
- Showing dialog box or writing text on the screen that is side effect.
- promp(“Enter passcode”); - that will show dialog box
console.log(1 +2); this will show 3 in the console. - Control flow - when a program contains more than one statement and they are executed as a story from top to bottom.
- The program to be executed only if certain condition holds.
- if keyword, and to create two separate alternative executions we are using else keyword.
-
A fragment of code that produces a value is called an expression.
-
is a variable should be cosidered like tentacles that grasp values when needed
3.The collection of bindings and their values that exist at a given time is called
the environment
4.A function is a piece of program wrapped in a value
-
alert (“you are beautilful”);
-
is a change that could display something on the screen or change the internal state of the machine affecting the statements coming after it
-
function that produce side effect:
alert (“you are beautilful”);
function that produce value:
console.log(Math.max(3, 6));
// → 6
-
control flow is the statements execution from top to bottom
-
conditional execution is how the program decides what to do based on certain conditions
-
else, if, else if
- it can be almost anything. An expression is a collection something
- like a tentacle that attaches to a value
- a collection of bindings and their values
- a piece of program wrapped in a value
- prompt
- like a box that pops up
- prompt gives a box and Math.min gives you the lowest value in a set
- the flow of code can be based on some variables
- if else, statements
- if
What is an expression?
A code fragment that produces a value
What is a binding?
An way of catching a value, ie via variable assignment
What is an environment?
A collection of bindings and there environment
What is a function?
A piece of a program that is wrapped in a value. It be applied in order to execute the program
Give an example of a function.
prompt(), alert(), etc
What is a side effect?
Give an example of a function that produces a side effect and another function that produces a value.
Side effects are effects produced by functions other than creating values. So something other than a return call.
console.log() has the side effecting of printing text
Math.max has no side effect
What is control flow?
The order of statement execution in a program.
What is conditional execution?
A condition-based change in the control flow, achieved by using if and other control statements.
What kind of keyword do you need to use to invoke conditional execution?
if
What is looping control flow allowing us to do?
Allows a section of code to be repeated
Describe what “loops” do in your own words.
Loops allow repeated execution of a piece of code to occur until a stop condition is met. Useful repetive operations
What is the difference between while and do-loops?
do loops will always execute atlease once
What is indentation?
Spacing that makes code easier to read
-
What is an expression?
a code fragment that provides a value -
What is a binding?
variable assignment to hold values - starting a statement with let creates and assigns a variable -
What is an environment?
The collection of bindings with values -
What is a function?
An expression or block of code wrapped in a value that can be returned or simply executed
. -
Give an example of a function.
Alert(“Ivan is a great teacher”); -
What is a side effect?
Expressions or functions to display or change the value on a website -
Give an example of a function that produces a side effect and another function that produces a value.
prompt(“What do you put in your coffee?”); -
What is control flow?
the order that code is executed -
What is conditional execution?
When the code values will determine what action is executed next -
What kind of keyword do you need to use to invoke conditional execution?
if, else
- An expression is the fragment of code that produces value. Every value that is written literally is an expression. An expression between parentheses is also an expression, as is a binary operator applied to two expressions or a unary operator applied to one.
- A binding is a process to catch and hold values. It can be also called a variable. The special word let indicates that this sentence is going to define binding. It is followed by the name of the binding and, to immediately give it a value, one can add an = operator and an expression.
- The environment is the collection of bindings and their values that exist at a given time. 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.
- alert(‘Hello World’);
- A side effect can be showing a dialog box or writing text to the screen.
- a) prompt(‘Enter something here’);
b) Math.max(2, 4); - Control flow is a way how to execute the code in JavaScript. For example, if the program contains more than one statement, the statements are executed as if they are a story, from top to bottom.
- Conditional execution happens when the programmer creates a branching road, where the program takes the proper branch based on the situation at hand.
- Conditional execution is created with the if keyword in JavaScript.
- Its returns the value of its binding .
- Binding () keep values together.
- Collection and their values that exist inside the program.
- Function its a input that produces the output .
- alert(“hello”);
- Side effect its a effect of particular function .
7 . Answer 5 its side effect . or alert(“this is side effect”)
console.log (6+6) - Direction executed by the program .
- Conditional statements are used to decide the flow of execution based on different conditions . If a condition is true, you can perform one action and if the condition is false, you can perform another.
- If , else
-
An expression is a sequence of value and operators that produces a value
-
when we create a new value from old values, and we want to use this value directly or in the future, we must make a binding. In the example let caught = 5 * 5 the word let indicates that this sentence is going to define a binding. It is followed by the name of the binding caught . We want to immediately give it a value, by an = operator and an expression. It is intended to fix the result of the multiplication 5 * 5. 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.
-
An environment is the collection of bindings and their values that exist at a given time. When a program starts up, this environment is not empty for example a web browser environment has functions to interact with the currently loaded website and to read mouse and keyboard input.
-
Functions are pieces of code written outside of the rest of the script. That code will only run when the script explicitly asks for it. If a script contains much of the same code, you can separate the code that is always the same in a function and call that function over and over again
-
in a browser environment,the binding prompt holds a function that shows a little dialog box asking for user input like a password.
-
A side effect is a visible change in the state of the application such as a dialog box that opens or writes text on the screen
-
Prompt holds a function that shows a little dialog box asking for user input.
console.log(- (10 - 2)) -
Control flow Is the order in which the computer executes the statements as if they are a story, from top to bottom.
-
a conditional execution is only carried out when a statement meets the requested conditions. We want some code to be executed if, and only if, a certain condition holds. If not, the statement is not executed and the program continues execution. An important keyword is if
-
Conditional execution is created with the if keyword
What is an expression?
Expressions are pieces of codes that produces a value and can be assigned to a variable. If it is not possible than it is a statement.
What is a binding?
Binding allows a program to store expressions for later use. Expressions are stored inside a variable.
What is an environment?
Environment refers to all the bindings with its corresponding values at any given moment.
What is a function?
A piece of code that is bound to a variable is called a function. These functions can be used multiple times without recoding it multiple times.
Give an example of a function.
function AverageApples(A, B){return (A + B) / 2;}
What is a side effect?
Side effect is an operation that changes the state of the computer such as changing a variable, interacting with the outside world such as prompting a dialog box, writing data to disk etc.
Give an example of a function that produces a side effect and another function that produces a value.
Example side effect è console.log(“Hello world”)
Example value è Math.round(5.5)
What is control flow?
The order that a program executes its code.
What is conditional execution?
Conditional execution means that a certain piece code is only executed if the conditions are met.
What kind of keyword do you need to use to invoke conditional execution?
if, else, else if, while
-
An expression is a piece of code to produce a value.
-
Bindings in expressions catch and hold values in the code and help it to produce a result. This result can be later defined as the binding. Bindings are flexible as they rather grasp values than contain them.
-
Environment is a collection of bindings and values that exist in a given time.
-
A function is a piece of program wrapped in value. These values can be applied in order to run the program.
-
let 1 = 100, two = 200 ;
console.log(one + two) ;
/ / → 300
-
A side effect happens if a statement changes the internal state of the machine in a way that will affect the statements that come after it. If you run a program, something observable happens.
-
With a side effect:
prompt (“Enter Password”);
With a value:
console.log(Math.max(45,56,78));
/ / → 78
-
Control flow happens when there are more than one statements in the program, and they are executed one after another.
-
Conditional execution happens when the program takes a proper branch based on the situation at hand.
-
The keyword for conditional execution is “if”.
-
Example : let b = 5430 is an expression as it creates the binding called b and attributing the value 5430 to it. An expression is basically a line code that ask the computer to do a specific action.
-
A binding is a creation of a space in the memory, and naming its address. The address will be used to call or write into this memory space.
-
It is the collection of all bindings and their values.
-
A function is a piece of code that do something, with input(s) and output(s).
-
prompt is a good example : it makes appear a dialog box asking for input. It will then store the input into a binding.
-
Side effects are all the changes made by a function that is not in his scope.
-
let Name = “BestNumber”;
const WorstFunction = () {
Name = “bestNumber”;
return 0;
};
The WorstFunction is change a binding Name, outside his scope to something different. This is a side effect -
Control Flow is the way the computer will execute : from top to bottom, just like people read.
-
Conditional execution is a way to execute code on certain condition : the “if” statement allows to do it. -> “if X is true, then, execute this piece of code.” The code will be executed only if X is in deed true.
-
If, else, but in a way “while” is also a conditional statement.
Glenn_CostaRica
1. What is an expression?
An expression is a fragment of code that produces a certain value, even in the case that the value is what is written as when we give a number (like 1 or 1278) or a string of characters like “hello”. So, in general, it’s a piece of code that results in a value.
2. What is a binding?
It refers to a designation of a determined space in work memory where some specified value will be kept, for example the value of a variable. The internal state of this memory space determines the value and it can be called through the space address.
3. What is an environment?
An environment is a set of bindings and all their states as they are disposed to be useful for a certain purpose, like in the case of all the data related to the execution of one particular program.
4. What is a function?
A function is a piece of code with one or more instructions that can take input values or not, and that can return some result values. The set of instructions perform one or several given operations.
5. Give an example of a function.
function myFunction(p1, p2) {
return p1 * p2; // The function returns the product of p1 and p2
}
6. What is a side effect?
“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.”
7. Give an example of a function that produces a side effect and another function that produces a value.
SIDE EFFECT:
function counter(x) {
return ++x;
}
VALUE:
function counter(x) {
x = x + 1;
return x;
}
8. What is control flow?
The control flow is the order in which the computer unit will attend the list of instructions; the statements are
executed “as if they are a story, from top to bottom” while paying respect to the logic of instructions.
9. What is conditional execution?
It’s a type of execution in which one instruction, or a set of instructions, is conducted if – and only if – some condition(s) are met. 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.
10. What kind of keyword do you need to use to invoke conditional execution?
if, else, if else
Please remember to always use preformatted text
when you post code in your answers!
It makes life soooo much easier for everyone. It’s not just a fancy function, it’s crucial and expected by all programmers to do so. We are getting this rolling so you might as well learn to follow industry standards.
In order to mark code, use 3 consecutive ticks at the beginning and 3 consecutive ticks at the end. A tick looks like an “upper comma”, and it is usually located on the top left-part of your keyboard, just left of the key 1
or see attached photo.
Just highlight the code sections and push the button. it’s that easy.
Let’s do this propper from now on, as a community.
Ivo
-
***What is an expression?
A. A fragment of code that produces a value is called an expression. -
***What is a binding?
A. JavaScript provides a thing called bindings or variables with are defined by the keyword “Let”, which indicates that the sentence will define a binding. -
***What is an environment?
A. It is a collection of bindings that exist at a given time. -
***What is a function?
A. A function is a piece of a program wrapped in a value. -
***Give an example of a function.
A. In a browser environment, the binding prompt holds a function that show a dialog box that requires input from the user, such as a box to enter your password. -
***What is a side effect?
A. Showing a dialog box or writing text on the screen is called a side effect. -
***Give an example of a function that produces a side effect and another function that produces a value.
A. The function the produces a dialog box prompting for password is a side effect
The expression (Math.max(2,4)) produces a side effect as a value. -
***What is control flow?
A. A program that contains more than one statement are executed from top to bottom. -
***What is conditional execution?
A. Conditional executions are created with the (if) keyword in JavaScript, providing certain condition are met. -
***What kind of keyword do you need to use to invoke conditional execution?
A. If, else
- A fragment of code that produces a value
- A binding is used to store value so it can be used later.
- The collection of binding and their values given at a certain time.
- A function is a piece of program wrapped in a value that can be applied to run the wrapped program.
in other words; a function is a block of code designed to perform a particular task. - promt(“waz up?”)
- Showing a dialog box or writing text to the screen.
- prompt(“Hello”); has the side effect of a prompting dialogue box.
console.log(Math.max(28, 48)); - When a program contains more than one statement, the statements are
executed as if they are a story, from top to bottom. - Very often when you write code, you want to perform different actions for different decisions.
You can use conditional statements in your code to do this. -
- Use
if
to specify a block of code to be executed, if a specified condition is true- Use
else
to specify a block of code to be executed, if the same condition is false - Use
else if
to specify a new condition to test, if the first condition is false - Use
switch
to specify many alternative blocks of code to be executed
- Use
- Use
- An expression is a fragment of code that produces a value. Ex: 2+4 is an expression.
- A binding holds and catches values.
- A collection of bindings and their values is called an environment.
- Function is a piece of program wrapped in a value.
- A function ex:
function count apples (janes apples, bobs apples) {
return janes apples+bobsapples ;
} - A side effect is a dialog box or writing text showing on the screen.
- Side effect: console.log
Value: math.max - Control flow is the order in which the computer executes statements in a script.
- Conditional execution is were a braching road is created, the program takes the proper branch based on the situation on hand.
- Conditional execution uses the IF keyword.
-
É um fragmento de código que produz uma expressão. Qualquer valor ou operador é uma expressão por si só. Expressões podem estar aninhadas dentro de outras expressões.
-
É um mecanismo (sentença) utilizado pelo Js para vincular valores na memória. Através de uma palavra chave, o JS cria um vínculo entre o nome do vínculo( existem alguns parâmetros a serem seguidos para a definição das palavras e caracteres aceitos e sua ordem) e uma expressão, através de um operador.
-
O enviroment é o conjunto de bindings e seus valores nativos de um programa, ao ser iniciado. O enviroment é importante para que o programa possa ter uma linguagem padrão e estabelecer conexão com outros programas e sistemas.
-
Função é uma parte de um programa atrelado ou embrulhado em um ou mais valores. Esses valores são utilizados para rodar o programa.
-
A função Prompt. (Utilizada para abrir uma janela onde o usuário pode inserir valores para que a função seja executada)
-
É o resultado de uma função no qual o usuário pode ver e interagir, sendo que o o resultado fa função não fica apenas como um valor “interno”.
-
A função prompt produz um efeito colateral e a função Math.max produz um valor
-
O Control flow indica a ordem com que declarações são executadas no programa. De cima para baixo. De dentro pra fora.
-
A Execução condicional é uma forma de programarmos para quando houver mais de um caminho possível para no nosso programa, de acordo com os valores obtidos em uma expressão.
-
If.
1 It is a code fragment that produces an expression. Any value or operator is an expression in itself. Expressions can be nested within other expressions.
2 It is a mechanism (sentence) used by Js to bind values in memory. Through a “keyword”, JS creates a bind between the binding name (there are some parameters to be followed to define the accepted words, characters and their order) and an expression, through an operator.
3 The enviroment is the set of bindings and their native values of a program, when started. Enviroment is important so that the program can have a standard language and establish a connection with other programs and systems.
4 Function is a part of a program linked or wrapped in one or more values. These values are used to run the program.
5 The Prompt function. (Used to open a window where the user can enter values for the function to be executed)
6 It is the result of a function in which the user can see and interact, and the result of the function is not just an “internal” value.
7 The prompt function produces a side effect and the Math.max function produces a value.
8 Control flow indicates the order in which statements are executed in the program. Top to bottom. From inside to outside.
9 Conditional execution is a way of programming when there is more than one possible path for our program, according to the values obtained in an expression.
10 If.
- ***What is an expression? fragments of code that produce a value
- ***What is a binding? a tentacle to catch and hold values
- ***What is an environment? collection of bindings and their values that exist at a given time
- ***What is a function?a piece of program wrapped in a value
- ***Give an example of a function. ex: alert(“this is ivan academy”);
- ***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() has side effect, math.max has no side effect
- ***What is control flow?the order that code is executed
- ***What is conditional execution?condition based on branch depends on situation
- ***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?
A binding is a way to catch and hold values. Example Michael = “awesome”; therefor in javascript, Michael is going to stay as “awesome” until another variable or method changes it. - What is an environment?
The collection of bindings and their values that exist at a given time. - What is a function?
a piece of program wrapped in a value. - Give an example of a function.
a function can be a site popup that implies the user to place in a password to enter. - 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.
an example of a side effect is alert = (“hello world”) in which it pops up on the screen.
An example of a side effect that produces a value is console.log (1+1); - What is control flow?
the control flow is that the program reads the code from top to bottom. - What is conditional execution?
a code to be executed in multiple ways dependent on the answer it is given - What kind of keyword do you need to use to invoke conditional execution?
if or else