Binding, Functions and Control Flow - Reading Assignment

  1. What is an expression?
    A fragment of code that produces a value is called an expression.

  2. What is a binding?
    A binding is a way to store values. These are names (variables) pointing to values, these pointers can be changed at any time.

  3. What is an environment?
    The collection of bindings and their values that exists at a given time is called the environment

  4. What is a function?
    A function is a piece of code wrapped in a value. To invoke a function the value has to be in an expression and arguments have to be given in parentheses. The number and type of arguments needed to be provided, depend on the invoked function.

  5. Give an example of a function.
    alert(“You are about to blow up the web”)

  6. What is a side effect?
    A side effect is an effect observable on the outside of a called function other than the return value.

  7. Give an example of a function that produces a side effect and another function that produces a value.
    alert(“This Message is a side effect”);
    consol.log(8+7); //This function does return a value

  8. What is control flow?
    This is the order in which the statements in the code are executed. This is from top to bottom.

  9. What is conditional execution?
    A condition is given under which a part of code is executed. Should this condition not be met the code under this condition is omitted.

  10. What kind of keyword do you need to use to invoke conditional execution?
    IF is the most used example keyword to invoke conditional execution of code. There are others as WHILE (enter and stay in a loop under certain conditions) or SWITCH (if there are multiple conditions to be checked)

1 Like
  1. A fragment of code that produces a value is called an expression.
  2. A binding holds values.
  3. The environment is the collection of bindings and their values.
  4. A function is a piece of program wrapped in a value.
  5. The console.log function.
  6. A side effect is showing a dialog box or text to the screen.
  7. Prompt to display something on the screen:
    prompt(“Today date is:”);
    or
    console.log(Math.max(2,4));
    // 4
  8. When a program contains more than one statement , the statements are executed from top to bottom.
  9. A conditional execution means that a branch of a program is executed if and only when the condition holds.
  10. The keyword needed is “IF”.
1 Like
  1. What is an expression?

An expression is a fragment of code that produces a value.

  1. What is a binding?

A binding is a thing that catches and holds values. Bindings are like tentacles in that they do not contain values, they grasp them.

  1. What is an environment?

An environment is the collection of bindings and their values that exist at a given time.

  1. What is a function?

A function is a piece of a program wrapped in a value. This type of value can be applied to run the wrapped program. A function is executed by applying it.

  1. Give an example of a function.

prompt

  1. What is a side effect?

A side effect is a change to the world or the internal state of the computer that is produced by a statement.

  1. Give an example of a function that produces a side effect and another function that produces a value.

The appearance of the sentence “This is a side effect.” on the screen is a side effect of the code - prompt(“This is a side effect.”)

Math.max - is an example of a value.

  1. What is control flow?

Control flow is the order in which statements are executed.

  1. What is conditional execution?

Conditional execution is the order in which statements are executed depending on various conditions.

  1. What kind of keyword do you need to use to invoke conditional execution?

You need to use the if keyword to invoke conditional execution.

1 Like
  • What is an expression?
    A part of cod that produces a value is an expression

  • What is a binding?
    a binding or variable is something that javascript uses to catch and hold values. is defined by the keyword that indicates it and its name. after a binding is defined his name can be used as an expression

  • What is an environment?
    the environment is the totality of binding and their values that exist in a determinate moment, never starts empty.

  • What is a function?
    functions are values that include fragments of program, those values can be applied(called, invoked) to execute the program.

  • Give an example of a function.

alert(hello!);
date(today);

  • What is a side effect?
    is usually produced by a function and it result in a dialog box, prompt, warning or text that appear on the screen.

  • Give an example of a function that produces a side effect and another function that produces a value.

alert(hello!);
math.max(7,4,6,8)*45);

  • What is control flow?
    Control flow is the “direction” in which the statement are executed.

  • What is conditional execution?
    A conditional execution is a statement or operation that get executed just if another condition is verified.

  • What kind of keyword do you need to use to invoke conditional execution?
    In Javascript we invoke a conditional execution with the keyword if

1 Like
  1. Expression is a fragment of code that produce a value.
  2. Bindings are like links in www. We can create a variable that refers to value or expression.
  3. Environment is a set of bindings and their values that exist in a given time.
  4. The function is a predefined set of instructions that we can use in our program. There is a set of standard functions like for example alert() that exist in standard environment but we can create our own functions.
  5. Example:
    function averageOfTwo (n1, n2) {
    return (n1 + n2)/2;
    }
  6. Side effect is when function does something more than just calculate on values. It can be showing a dialog box or printing text on the screen.
  7. Function with side effect is alert() and producing a value is Math.max().
  8. Control flow is an order that statements are executed. It’s from top to the bottom.
  9. Conditional execution means that certain part of code will be executed only if some condition is fulfilled.
  10. We need to use “if” statement.
1 Like
  1. An expression is a fragment of code that produces a value.

  2. A binding is a way to catch and hold values.

  3. An environment is the collection of bindings and their variables that exist at a given time.

  4. A function is a piece of program wrapped in a value.

  5. An example of a function can be:
    prompt (“enter password”);

  6. A side effect is any application state change that is observable outside the called function other than its return value.

  7. An example of a function that produces a side effect:

prompt (“enter password”);

An example of a function that produces a value:

console.log(Math.max(2, 4));
// → 4

  1. Control flow is the way the statements are executed, from top to bottom.

  2. Conditional execution is a branching road where the program takes the proper branch based on the particular situation

  3. To invoke conditional execution I need to use the keyword if.

1 Like

1 A fragment of code that produces a value.
2. System Js uses to catch and hold values
3. Collection of bindings and their values
4. A piece of code that produces a certain task
5. alert (This is a pop up alert);
6. A change in the machine that will produce an observable outcome
7. side effect:
prompt(“enter name”);
Value:
console.log(math.max(1,2,3));
8. The order in which the program will read the code
9. A conditional execution will create different pathways the program can follow depending on the situation
10. “if” and “else”

1 Like
  1. Any code that returns a value.
  2. It is a pointer to a value, also called variable.
  3. It is the group of variable that exist in an app at a given time.
  4. A piece of code that does something specific. Can be called at any given time to execute.
  5. alert(“hello world”);
  6. Observable change in the app.
  7. prompt(“enter your name”);
    console.log(2+2);
  8. The order in which the code is read by the computer.
  9. Something that will execute if certain conditions are true or false.
  10. if.
1 Like

[quote=“ivan, post:1, topic:3069”]

  • What is an expression? a fragment of code_ that produces a value
  • What is a binding? or a variable
  • What is an environment? a collection of variables can interact with the surrounding system, other programs
  • What is a function? a piece of program wrapped in Value
  • Give an example of a function. promt (“enter Passcode”) promt is the function functions invoke, call, or apply
  • What is a side effect? return value produced by a function and has a useful application
  • Give an example of a function that produces a side effect and another function that produces a value. (math.max) funtions of math
  • What is control flow? steps of the functions as written and performed to satisfy the desired results
  • What is conditional execution? not all executions will follow a straight line of flow, flow path and steps result dependent on value outcomes can follow various paths
  • What kind of keyword do you need to use to invoke conditional execution? if
1 Like

I have a question about how the Practice part of this lesson goes, I see Ivan with the Programming page of Atom or something and console. also open ,… how is this??

if we are always writing to our browser site or what?

1- fragment of code that produces a value
2- connections to values
3- a 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- prompt(“Enter passcode”);
6- Showing a dialog box or writing text to the screen
7- (Math.max(2, 4));
8- When your program contains more than one statement, the statements are executed as if they are a story, from top to bottom
9- where the program takes the proper branch based on the situation at hand.
10- if

1 Like

Do you mean the split screen?
Can you post a screenshot?

Ivo

Ab yes must be just a split screen, I see it now

Thanks

Isaac

1 Like

An expression is when you are returned a value based on coding.

A binding is a name given to a keyword so it can be recalled on later in an expression.

The entire set of bindings and their values is to be considered the environment.

Functions are individual programs within the default environment. They can be called upon by giving them a value within a set of parentheses.

An example of a function would be: let boostingsnail = "Is an amateur of ";

A side effect is a returned value that changes the outcome of functions that follow it. Some side effects change what is displayed to the end user.

Example of function that produces side effect: alert("Good Morning");
Example of function that produces value: console.log(200/5);

In Javascript, control flow means that statements are executed from top to bottom.

Conditional execution is when there are multiple paths to what might be returned at the end.

‘IF’ is the keyword for conditional execution.

Edit @ivga80 : Hi, you should use the preformatted text (</>) feature to show the code in the post. :wink:
Good luck. :+1:

A fragment of code that produces a value.
2.
It is the way a program remember things and keep their internal state, it can be expressed using keywords, variables such as “let”, “var” as well as “const”; it works as tentacles, grasping or referencing to information or value, and can be attached to more than one value.
3.
It is the collection of bindings and their values that exist at a given time.
4.
It is a piece of program wrapped in a value. It can be applied
in order to run the wrapped program.
5.
The console.log(“The console.log is a function”), that prints the message between the brackets in the console screen.
6.
Something on the screen that changes the internal state of the machine in a way that will affect the statements that come after it. A text or dialog box showing on the screen.
7.
Side effect: console.log(“Print this on the screen as side effect”);
Value: var value = 77 + 3;
8.
It is the order in which the program reads its written statements, from top to bottom in a straight line. Converting and combining values to tell the story of the program.
9.
It is when you have multiple possible paths to follow, based on the situation at hand, according to the “if” keyword statement or boolean logic; and its adequated to the attached pathway, that is executed only if the requirements are met.
10.
If, else if, else.

1 Like

What is an expression?
A fragment of code that produces a value. This includes values written such as 22. Expressions can be include other expressions.

What is a binding?
A binding is a reference or a pointer which can point/refer to a value/expression. They can be created without referring to anything initially and are therefore undefined. They can be reassigned to refer/point to something else unless created as a constant.

What is an environment?
It is the space in which expressions, values etc exist. It exists from the start of a program until it exits.

What is a function?
A function is a piece of code which can be called with passed in values called auguments (or parameters). It can return a value.

Give an example of a function.
console.log(10 * 10);

What is a side effect?
It is when something else is caused to happen besides the return value. In the above example the side effect is that the value returned is written to the console.

Give an example of a function that produces a side effect and another function that produces a value.
console.log(Math.max(24,135));
The console.log function has the side effect of writing 135 to the console, while Math.max() has no side efffect but just returns the value 135.

What is control flow?
It is the order in which program statements are executed. In a basic program it is one after the other sequentially.

What is conditional execution?
It is when a piece of code is only executed when a certain condition is true.

What kind of keyword do you need to use to invoke conditional execution?
A conditional keyword such if(expression to be true) { statements} else { statements to execute when condition was false}
The else above is optional

1 Like
  1. An expression is any code that can produce a value
  2. Bindings are the way we point variables to some value, not holding but grasping them.
  3. The environment are all the bindings and values that exists in a given time.
  4. A function is a program that is wrapped in a value. The purpose is to run the specific program.
  5. alert(“I guys”)
  6. Side effect is produced when a function changes a something outside it’s scope.
  7. prompt(“What is you name?”)
    Console.log(math.max(4,6)+10);
  8. Control Flow is the way the program as to read more than one statement as it was a story and produce the final value.
  9. Conditional execution is the form the program as to respect conditions in order to produce the final value.
  10. If and else
1 Like
  1. An expression is any part of the codes that produces a value.
  2. A binding is declaring a variable that can store an expression or function and can be call at a later time.
  3. An environment is a collection of bindings.
  4. A function is a block of code to perform a specific task. Functions can be execute by invoking or calling the function name. Values can be pass to a function which are called arguments.
  5. An example of a function is the prompt(“Hello World”), alert(“Hello World”), console.log(“Hello World”).
  6. A side effect is any value return by a function that can be print to the screen or dialog box.
  7. Side effect function: alert(“Hello World”), and function that produces value: function myName(name) { return "Hi, I am " + name; }
  8. Controlling the execution of more than one statements is call a control flow. This can be a straight line control flow or with conditional statements.
  9. A conditional execution is an execution of a statement that matches a an if condition.
  10. Conditional execution needs a keyword if.
1 Like
  1. Any unit of code that can be evaluated to a value is an expression

  2. Binding is used to bind objects and functions together.

  3. A collection of bindings and their values existing at a given time.

  4. A function allows you to define a block of code, give it a name and then execute it as many times as you want. A JavaScript function can be defined using function keyword.

  5. function greet () {
    console.log ('Hello World");
    }

  6. Side effect is a way of saying ‘this function changes some variables outside of the function’

  7. Confirm function produces an extra window, Math.max gives a value.

  8. Control flow is in computer science the order that the instructions or statements or functions are executed. In javascript, we read the code starting from the first line till the last line unless of course in the code there is some instructions or statements that changes that control flow.

  9. Conditional Execution is 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 action.

  10. If and Else

1 Like

Answer:

  1. An expression is a statement of code that creates value. An expression can contain expression inside itself.
  2. Binding is a statement of code that creates a connection between value and variable. That variable is now storing that value in the memory ( it is bind to it) for later use in expressions. If you want to get that value, you can call for the variable (binding).
  3. An environment is a set of bindings and their values or functions that exist at a given time. They can be called upon or used in the current environment. For example, a browser has its environment bindings like the F12 key, which opens Console.
  4. A function is a piece of code that performs a task with a given value.
  5. var c=2; var d=c*c; d;
    Function “d” multiplies value given to “c” which is “2” by itself. The result of the function “d” is “4”.
  6. A side effect is a property of a function when the execution of that function invokes some visual response like writing a text on the screen or showing a dialog box.
  7. console.log(); This function has a side effect of showing whatever argument was put inside of that function.
    var d=5+3; This function produces a value of 8.
  8. Control flow is a program that has more than one statement. It executes from top to bottom and returns a particular value or side effect.
  9. Conditional execution is a control flow with multiple choices at hand. It means that depending on the environment at the time, a program can have more than one result. To get to each result, the program has to choose different routes.
  10. Conditional execution created with the “if” keyword in JavaScript. It means that the program executed only if a certain condition met.
1 Like