Binding, Functions and Control Flow - Reading Assignment

1. What is an expression?
it is a fragment of codes that produces values, if an expression correpond to a sentence fragment.

2- . What is a binding?
Enables JavaScript to catch and hold values in order to keep and internal state of a program or to keep things,
3- What is an environment?*
the collections of bindings and their values that exist at a given time it is called the environment.

4-what is a function
it is a piece of program wrapped in a value that contains instructions used to create the output from its input,

5- Give an example of a function
console.log();

6-what is a side effect?
showing a dialog log or writting text to the screen, is a side effect .

7-
let mood = “light”;
console.log(mood);
// → light
mood = “dark”;
console.log(mood);
// → dark

console.log(Math.min(2, 4) + 100);
// → 102

8-what is control flow
it’s when your program contains more than one statement, the statement are executed as if they are a story

9-what is conditional execution
it controls whether or nor the core will execute an instruction, Because all program are not straight roads,

10- 1. What kind of keyword do you need to use to invoke conditional execution?
the else keyword together with If

1 Like
  1. An expression is a fragment of code that produces a value.
  2. A binding is meant to catch and hold a value.
  3. An environment is a collection of bindings and their values.
  4. A function is a piece of program wrapped in a value.
  5. An example would be a prompt in the browser environment.
  6. A side effect is a change to the internal state as the result of code.
  7. A function that produces a side effect can be a dialog box, while one that produces a value can be the max math function.
  8. Control flow is reading the statements from top to bottom.
  9. Conditional execution is a way to create two pathways or branches using if else keywords.
  10. If and else keywords.
1 Like
  • What is an expression?
    • a piece of code that produces a value
  • What is a binding?
    • the process javascript uses to catch and hold values, they are like tentacles
    • the keyword let states there will be a binding, followed by the name of the binding
  • What is an environment?
    • the collection of binding and their respective values that exist are called the environment
  • What is a function?
    • program wrapped in a value, when you execute a function it’s know as calling, invoking or applying
  • Give an example of a function.
    • an example is the binding prompt which has the function of asking for a password
  • What is a side effect?
    • when a statement changes what comes next by changing the state of the internal machine, like showing showing new text to a user on the screen.
  • Give an example of a function that produces a side effect and another function that produces a value.
    • side effect - logs a user in after inputting passcode shows new text box
    • value - a user doing a math program to get a new value
  • What is control flow?
    • statements in javascript are executed in order from top to bottom, it’s like a straight road
  • What is conditional execution?
    • branches off from executing from top to bottom and is created with the if keyword, which can allow for skipping certain parts of the flow or brining to another part unlike the more linear path of control flow.
  • What kind of keyword do you need to use to invoke conditional execution?
    • if
1 Like

1.) An expression is a piece of code that evaluates to a value.
2.) A binding is a variable that is attached to a value.
3.) The environment is the program with preexisting bindings used for writing code.
4.) A function is a piece of code wrapped in a value, which performs an operation or series of.
5.) math.max(a, b);
6.) A side effect is what an execution of a function which results in an observable change of state other than its return value.
7.) prompt(“abc”); calls for a value to be entered within a side effect in the form of a prompt box in the browser, and math.min(a, b); returns a value.
8.) Control flow is the path of code execution which may vary.
9.) To invoke a conditional execution, often the keyword “if” is used before a statement.

1 Like
  1. Expression is a part of code that produces value.
  2. Binding enables to hold and attach values.
  3. The environment is a collection of bindings and their values at a given time.
  4. A function is a piece of program wrapped in a value.
  5. Example of a function: prompt(“Enter Password”);
  6. Side effect is an operation that affects the execution of a program.
  7. alert(“Hello”) produces side effect, console.log(Math.min(3, 6) + 100) produces a value.
  8. Control flow is when a program contains more than one statement and the statements are executed as if they are a story, from top to bottom.
  9. Some code executes if and only if a certain conditions holds. There can be more than two paths to choose from.
  10. Conditional execution is created with if keyword. You can use else keyword together with if to create two separate execution paths.
1 Like
  1. What is an expression?
    a portion of code or a program that produces a value

  2. What is a binding?

  3. a binding is a JS programing feature that allows you to catch and hold, or to remember a value to be used in expression later in the program.

  4. What is an environment?
    this is an collection of bindings and their values that exists at the current time.

  5. What is a function?
    a piece of a program wrapped in a value

  6. Give an example of a function.
    console.log (“hello world”)

  7. What is a side effect?
    it is the changes and there impact caused by changing values in variable and refers to impact of these changes happening later in the program. (not sure if this an accurate description, pdf book is not very clear on this)

  8. Give an example of a function that produces a side effect and another function that produces a value.
    console.log (“hello world”)

  9. What is control flow?
    it is the order in which the program is run.

  10. What is conditional execution?
    depending on a input conditions that is used or provided the program may take a different path in the control flow that is relevant for that particular input.

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

1 Like
  1. An expression is a fragment of code that provides a value.
  2. Binding is how Javascript catches and holds values. Bindings can disconnect from that value and connect to a different value if the programmer finds it necessary.
  3. Environment is a collection of bindings and their values that exist at a given time. When a program starts the environment contains bindings that are part of the language standard.
  4. A function is a piece of code wrapped in a value.
  5. alert(“Enter passcode”);
  6. A side effect shows a dialog box or writing text to the screen. Many functions are useful because of side effects.
  7. prompt is an example that produces a side effect by providing a dialog box. Math.max is a function that produces the greatest value of a statement
  8. Control flow is when a program contains more than one statement. The statements are executed top to bottom like a book.
  9. A conditional execution is when the program takes one of may paths due to circumstances within the code.
  10. The keyword “if” is used to invoke a conditional execution.
1 Like
  1. What is an expression?
    is a fragment of code that produces value

  2. What is a binding?
    this is inner system that catch and hold value

  3. What is an environment?
    an environment is the collection of bindings and their value that exists at a given time. an environment is not empty while the program is executing, it has bindings that provides ways to interact with the surrounding system.

  4. What is a function?
    is apiece of a program that is inside or closed in the value.

  5. Give an example of a function.
    alert(“business only”);

  6. What is a side effect?
    this is writing a text on a screen. many of the functions are useful from the side effect they produce.

  7. Give an example of a function that produces a side effect and another function that produces a value.
    console.log(“user name”);

console.log(math.max(2,4));
value / / =4
8. What is control flow?
is the executing of more than one statement from top to bottom as if they are a story in a program.
9. What is conditional execution?
Not all programs are straight roads. We may for example, want to create a branching road where the program takes the proper branch based on the situation at hand.and this is conditional execution.

  1. What kind of keyword do you need to use to invoke conditional execution.
    if , if / else.
1 Like
  1. What is an expression?
    An expression is a fragment of code that produces a value.

  2. What is a binding?
    A binding in Javascript is to catch and hold values.

  3. What is an environment?
    An enviroment 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.
    alert(“hello there”)

  6. What is a side effect?
    Side effects are changes caused by the program whether it is visible, such as displaying something on the screen.

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

    • prompt(“Enter passcode”); produces side effect by displaying a dialog box on the screen
    • Math.max(2,4) - returns the max value among the group of values
  8. What is control flow?
    Control flow is the flow or movement direction of the program, normally from top to the bottom.

  9. What is conditional execution?
    Conditional execution is when a part of the program is executed when certain conditions are fulfilled

  10. What kind of keyword do you need to use to invoke conditional execution?
    The keyword is “if” and/or “else”

1 Like
  1. A fragment of code that produces a value.
  2. The name of the method of catching and holding values.
  3. Collection of bindings and their values.
  4. A piece of program wrapped in a value.
  5. I think this is the “Enter Passcode” part of prompt(“Enter Passcode”);
  6. The result of a function. Like showing text on a screen.
  7. Showing a dialogue box, console.log(Math.Max(2,4));
  8. When there are multiple statements within a program they are executed from top to bottom like in a story.
  9. Exactly what it sounds like.
  10. IF and a boolean value.
1 Like

What is an expression?
A fragment of code that produces a value
What is a binding?
Something that catches and holds values.
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 browser environment,
the binding prompt holds a function that shows a little dialog box asking for
user input.
What is a side effect?
changes to the world or the internal state of the machine.
Give an example of a function that produces a side effect and another function that produces a value.
Math.max which gives back the greatest out of the numbers you give it and then Math.min which does
the opposite of Math.max
What is control flow?
statements being executed as if they are a story, from top to bottom
What is conditional execution?
creating a branching road, where the program takes the proper branch based on the
situation at hand
What kind of keyword do you need to use to invoke conditional execution?
The if keyword in JavaScript

1 Like
  1. An expression is any part of the JavaScript language capable of returning a value.
  2. Binding is the assignment of a variable to a value.
  3. Environment is the set of bindings of variables to values that exist at a given time.
  4. Function is a piece of programming represented by a name. For each parameter entered, the function returns an output.
  5. function addNumbers (a,b) {
    return addNumbers (a+b)
    }
  6. A side effect is some change in the state of affairs, some repercussion on the screen or in the continuity of program execution.
  7. The function ‘alert’ produces a side effect. The function Math.max produces a value.
  8. The control flow is the order in which individual statements are executed, when there is a plurality of them.
  9. Conditional execution is a type of control flow in which there is an execution branch, depending on the situation.
  10. We use the keywords ‘if’, ‘else if’, ‘else’.
1 Like
  1. An expression is a fragment of code that produces a value.
  2. A binding is a way for Javascript to catch and hold values.
  3. The 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. An example of a function is prompt(“Enter your pin here”);
  6. A side effect is showing a dialog box or writing text to a screen.
  7. An example of a function that produces a side effect is prompt(“Enter your password”); and an example of a function that produces a value is console.log(360*702);
  8. Control flow is where your program has more than one statement, and they are executed top to bottom.
  9. Conditional execution is where there is a branching road and the program takes the proper branch based on what conditions are met.
  10. You need to use the keyword if.
1 Like
  1. A fragment of code that produces a value

  2. Binding (variable) is a statement that lets the program save a value in the memory

  3. A collection of bindings and their values

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

  5. function dibujarLinea(color, xinicial, yinicial, xfinal, yfinal)
    {
    lienzo.beginPath();
    lienzo.strokeStyle = color;
    lienzo.moveTo(xinicial, yinicial);
    lienzo.lineTo(xfinal, yfinal);
    lienzo.stroke();
    lienzo.closePath();
    }

  6. If a statement or function modifies the state of something else (outside its own scope), then it is
    producing a side effect.

7 prompt(“What´s your name?”);
var x = 49
var y = 51
console.log(x + y)

8 It is the direction of execution of code in JavaScript which happens in a top down approach.

  1. A branching road, where the program takes the proper branch based on the
    situation at hand

  2. Conditionals. if, while, for, else…

1 Like
  1. A part of a code that stands for a value is an expression.
  2. A binding is a piece of memory that can hold a value.
  3. A group of bindings and the value they hold at a certain time.
  4. A value that contains a code
  5. An example of a function can be one that sums two given number together. This function can be called uppon to by typing the binding of that function and put the right input values in it.
  6. A side effect happens when something outside the environment of the code is changed.
  7. Side effect function: prompt("…");, value function: Math.max(2, 4)
  8. Control flow is the order of statements when a code contains more than one statements and it forms a program
  9. An certain execution in the code is only done when a certain condition is met.
  10. if, else or if else
1 Like
  • What is an expression?
    A fragment of code that produces a value

  • What is a binding?
    A way to capture and hold previous values. eg let lee = cool. then from that point, any time someone enters lee into script it sees it as “cool”

  • What is an environment?
    A 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.
    alert(“See my popup”)

  • What is a side effect?
    when you show 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.
    alert(“Hi there”)
    lee+john

  • What is control flow?
    the order statements are executed in a program - top to bottom

  • What is conditional execution?
    when we want a specific direction a program takes to be based on conditions being fulfilled

  • What kind of keyword do you need to use to invoke conditional execution?
    if

1 Like

1 A pice of code that produces a value.

2 A binding holds value to a word so you can reference it later.

3 An environment are all the binding and values that exist within it.

4 A function is code that the program can call on to compute a value.

5 function add(a, b) {
return a + b
}

6 Something that effects the internal state of the machine and will affect the statement that comes after it

7 Side effect (“enter password”)
console.log(a + b)

8 In JavaScript the direction of the execution of code is a top down approach.

9 when you execute a command based on a condition.

10 If and Else are the keywords

1 Like
  1. An Expression is code that returns a value.
  2. A binding is a way to remember values. It is a pointer. It names a memory address.
  3. An environment is a collection of values for all the bindings/variables related to the program.
  4. A function is made up of code: commands, expressions, etc. and is organized to accept and return parameters. The function is given a name and this identifies the function to be called at various points in your program.
  5. Function Example : prompt(“Enter Password”); prompt is the name of the function. Enter Password is the value passed to the function.
  6. A side effect is the result of a function, expression or statement, changing a value or state of the program. A side effect occurs when the value or appearance of an object is changed.
  7. Function with a side effect: prompt(“Enter Password”); Function changing a value: const square = function(x) {
    return x * x;
    };
  8. Control Flow determines the order in which code is executed.
  9. Conditional Execution is Code that runs only if certain conditions are met or while certain conditions remain intact.
  10. An example of a conditional keyword is :
    if i < 10 += i;
1 Like

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

2 It is a thing used by JavaScript to catch and hold data.

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 date of birth") ;

6 A Side effect is a statement or function that produces an expression and returns a value

7 fun sum (a:Int, b:Int): Int {
log.info(“Added $a + $b”)
return a + b
}

8 the **order in which individual statements, instructions or function calls of an imperative program are executed or evaluated.

9 Conditional execution controls whether or not the core will execute an instruction. ie if A = True execute B.

10 Use

1 Like
  1. What is an expression?
    Fragment of code that produces value.

  2. What is a binding?
    is the relationship between a name and a value.

  3. What is an environment?
    a collection of bindings and values in the current session or page.

  4. What is a function?
    a Function is a piece of program wrapped in a value.

  5. Give an example of a function.
    concole.log()

  6. What is a side effect?

  7. Give an example of a function that produces a side effect and another function that
    produces a value.
    side effect: console.log(); value: Math.max();

  8. What is control flow?
    Control flow of a program is the order or the path taken to execute the statements in
    that program.

  9. What is conditional execution?
    is a function that allows the program execute some code if the statement provided
    agrees with the condition.

  10. What kind of keyword do you need to use to invoke conditional execution?
    “if” or “else” or “if else”

1 Like