Binding, Functions and Control Flow - Reading Assignment

1Expression is a piece or element of code that produces value.
2, JavaScript’s solution to catch and hold a value (but NOT contain value)
3, Environment where a collection of bindings and their values exist.
4, A piece of program wrapped in a value.
5, prompt
6, Side effect is an outcome what makes a function useful
**7,**Function that produces side effect is “prompt” by showing a dialog box on the screen that asks the user for an input.
Function that produces a value is Math.max or Math.min when it takes the greatest or the smallest item from a function
8, When the program has more than one statement. It is executed from the top to the bottom, represented in one line.
9, not entirely sure about the right answer
10, if

1 Like
  1. It’s the code that produces a value

  2. The bind method is used when we want to bind an object to a common function so that the function gives different result when its needed

  3. A collection of bindings with their values which exist at the time the program is operating.

  4. A set of statements that performs a task or calculates a value, but for a procedure to qualify as a function, it should take some input and return an output where there is some obvious relationship between the input and the output.

  5. console.log / prompt / alert

  6. A side effect is a result of a function being executed, such as displaying a dialogue box or or writing text to the screen.

  7. Prompt(what is your name);
    console.log(213*4);

  8. Control flow is the order in which your program’s statements are to be executed, which is done from top to bottom unless conditional execution is used.

  9. it is a execution that is only being fulfilled if a certain statement is true.

  10. if / else

1 Like
  1. What is an expression?
    Expression is a piece of code that prodces a value. Also that value can be called expression.

  2. What is a binding?
    Binding is a setting of value to a defined name.

  3. What is an environment?
    It is a set of values currently binded when you start the environment (when you open a website for example).

  4. What is a function?
    Function is a piece of program. By entering values (arguments) into the function we can run it.

  5. Give an example of a function.
    console.log(Math.sqrt(4));

  6. What is a side effect?
    Side effect is an effect of function which shows a return or dialogbox or just a value on screen.

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

  • function that produces a side effect:
    prompt(“Enter username”);
  • function that produces a value:
    Math.sqrt(4);
  1. What is control flow?
    Control flow is an order acording to which are statements executed - from top to bottom.

  2. What is conditional execution?
    Conditional execution is a case where function is executed only under some current circumstances.

  3. What kind of keyword do you need to use to invoke conditional execution?
    if/else

1 Like
  1. What is an expression?
    A fragment of code that produces a value is called an expression. Every value
    that is written literally (such as 22 or “psychoanalysis”) 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.

  2. What is a binding?
    Binding allow us to bind any name to a value. For example:
    let caught = 5 * 5;
    Where “caught” is a name and “5*5” is a value

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

  4. What is a function?
    A function is a piece of program wrapped in a value. Such values can be applied in order to run the wrapped program.

  5. Give an example of a function.
    prompt(“Enter passcode”);

  6. What is a side effect?
    Side effect means that the output value is different to the input value you give. Showing a dialog box or writing text to the screen 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(Math.max(2, 4));
// → 4

Exact value given:
var a = 4
console.log(a);
VM177:2 4
Undefined

  1. What is control flow?
    Control flow is the order in which individual statements, instructions or functions are executed or evaluated.

  2. What is conditional execution?
    In the simple case, we want some code to be executed if, and only if, a certain condition holds. We may, for example, want to create a branching road, where the program takes the proper branch based on the situation at hand.

  3. What kind of keyword do you need to use to invoke conditional execution?
    Conditional execution is created with the if keyword in JavaScript.

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

  2. A binding is the association of method call to method definition there are two types static and dynamic.

  3. The environment is the collection of variables 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: alert (“Good Morning”);

  6. A side effect is the product of a function.

  7. Side effect example: alert (“hello world”);
    Value example: console.log(Math.max(2,4));

  8. Control flow is the direction of execution of code from top to bottom.

  9. Conditional execution is where we choose between two different routes based on a boolean value.

  10. if, else

1 Like
  1. A fragment of code that produces a value. Every value that is written literally (such as 22 or “psychoanalysis”) is an expression. An expression between parentheses is also an expression.

  2. A binding catches and holds values, think of a tentacle rather than a box. Bindings don’t contain values, they grasp them.

  3. The collection of bindings and their values that exist at a given time.

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

  5. prompt()

  6. 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. Side effect = prompt(what are you drinking today?) , Value = console.log(Math.max(2, 4));

  8. Control flow is when your program contains more than one statement, the statements get executed as if they are a story, from top to bottom.

  9. Conditional flow is a branching road, where the program takes the proper branch based on the situation at hand.

  10. Conditional execution is created with the if keyword.

1 Like
  1. An expression is a fragment of code that produces a value. An expression can contain multiple expressions and wind up building complex computations.
  2. A binding holds a value to be called back later. Some bindings are able to later be changed (let) whereas some hold a value and keep it there, (const) and (var). A binding can be any word, so long as it is not a reserved keyword and does not start with a digit.
  3. An environment is an existing collection of bindings and their values - there are always bindings as part of the language standard + the bindings the programmer created.
  4. A function is a piece of program wrapped in a value.
  5. console.log() prompt () alert()
  6. Side effects are produced by functions - they show a dialog box or write text to the screen.
  7. The prompt function produces a side effect of a dialog box on the screen. A function that produces a value could be one like Math.max, which returns the greatest of any number arguments
  8. The order in which the statements of a program are executed.
  9. Conditional execution is where the program can take a fork or branch depending on an “if” statement. There might be only two options, and given x input, x program executes, and given y input, y program executes.
  10. one that executes or skips a statement depending on the value of a Boolean expression - “if” to create an alternate execution path, you can pair with “else”
1 Like
  1. A fragment of code that produces a value is called expression.
  2. To catch and hold values , java script provides a thing called binding or variable.
    3.the collection of bindings and there values that exist at a given time is called the environment.
    4.a function is a piece of program wrapped in a value.
    5.in a browser environment the binding prompt holder a function that shows a little dialog box asking for user input.
    6.showing a dialog box or writing text to the screen is a side effect.
    7.prompt(“enter your name”)console.log(Math.max(2,4)); producesba value
    8.control flow is the order in which the computer executes statements in scripts.
    9.conditional execution control behavior in Javascript wether or not pieces of code can run.
    10.the keyword “If” tells Javascript to start the conditional execution.
1 Like
  1. Fragments of code that produces a value.
  2. Catches and holds values.
  3. Collection of binds and their values that exist at a given time.
  4. A Group of code or expression that can be called by a program to compute a value.
  5. alert(“alert is a function!”)
  6. A dialog box or writing text to the screen
  7. prompt(“Enter name”); console.log(Mat.min(2,4);=2
  8. Order in which we code and have our statements evaluated.
  9. A condition must be meet before execution
  10. if, else, while, loop
1 Like
  1. An expression is “a fragment of code that produces a value”
  2. Bindings (or variables) are are assignments to catch and hold values.
  3. An 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” that can be used/called in the current environment.
  5. console.log
  6. A side effect is an “observable effect besides returning a value”.
  7. promt produces the side effect of showing the dialog box
    Math.max takes any amount of number arguments and produces a value with the greatest
  8. Control flow is the order in which statements are evaluated and executed.
  9. Conditional Execution is the way to execute different statements depending on conditions.
  10. if
1 Like
  1. An expression is a fragment of code that produces a value.
  2. A binding is a keyword used to catch and hold values in a program.
  3. An 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. Such values can be applied in order to run the wrapped program.
  5. An example function is prompt(). This function uses the string that we give it as the text to show in the dialog box.
  6. A side effect is anythng that changes the internal state of the program in a way that it will afect the statements that come after it.
  7. prompt(x) is an example of a function that produces a side effect, Math.max(x,y) is an example of a function that returns a value.
  8. Control flow is a programming technique that allows execution to branch to other parts of a program instead of running from top to bottom.
  9. Conditional execution uses if/else statements to execute a part of a program based on a given criteria.
  10. Use if, else if, and else statements for conditional execution.
1 Like
  1. A fragment of code that produces a value is called an expression. Every value that is written literally is an expression.
  2. To catch and hold values, JavaScript provides a thing called a binding or variable.
  3. The environment represents 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. Such values can be applied in order to run the wrapped program.
  5. prompt holds a function that shows a little dialog box asking for user input. It is used like this: prompt("Enter your name: ");
  6. Side effect is showing a dialog box or writing text to the screen.
  7. prompt(“Enter your name: ”) produces a side effect and console.log(5+2) produces a value, 7.
  8. Control flow is when your program contains more than one statement, the statements are executed from top to bottom.
  9. Conditional execution is used when you want to create a branching road, where the program takes the proper branch based on the situation at hand.
  10. Conditional execution is created with the if keyword in JavaScript.
1 Like
  1. An expression is a piece of code that can be read and have an output value.
  2. Binding is a value with that holds an expression.
  3. An environment is a collection of bindings with values that work for some time.
  4. A function is something that the computer reads and figures out for the human.
  5. A function could be prompt(“What is the password?”)
  6. When the function has to appear with something else; like a dialog box or something to write text.

An example that has a side effect is prompt(“What is the password?”)
An example that has a value produced is console.log(29+1)
8. Control flow is the order in which the lines of code are executed.
9. Conditional execution is when a line of code is only executed depending on other lines of code.
10. IF

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

  2. A binding is a tag used to keep a value.

  3. The environment is the collection of bindings and relative value that exists at a given time
    in a program.

  4. A function is a piece of program, wrapped in a value, that receive in input some values and produce
    in output another value or a side effect.

  5. An example of a function is: consolo.log();
    this function gets the input argument, written inside the brackets, and
    prints it on the console.

  6. A side effect is a change in the internal status of the machine on which the program runs
    or something that is printed on the screen.
    Side effects are produced as possible consequences of invoking functions.

  7. A function that produce a side effect is prompt():
    prompt() open a dialog window on the screen where the user can insert an input value.
    A function that produce a value is Number():
    Number convert the input argument into a number.

  8. The control flow is the logic scheme that describe how the program runs from top to bottom.
    A straight-line control flow is represented by a straight arrow going from the start
    to the end of the program.

  9. A conditial execution is when a program, along its execution, can follow different branches
    depending on the conditions met at a certain time.

  10. The keyword used to invoke conditional execution is if.

1 Like
  1. What is an expression?
    Fragment of code that produces a value
  2. What is a binding?
    Stick a value to a variable
  3. What is an environment?
    Collection of variables and their values at a given time, a program is never empty
  4. What is a function?
    A piece of program wrapped in a value
  5. Give an example of a function
    Alert(“warning”);
  6. What is a side effect?
    A function`s secondary effect
  7. Give an example of a function that produces a side effect and another function that produces a value
    Alert(“what ever”)
    Console.log(4)
  8. What is a control flow?
    The direction who the statements are executed one after another
  9. What is a conditional execution?
    When the program has an option to choose between more routes to execute statements
  10. What kind of keyword do you need to use to invoke conditional execution?
    if
1 Like
  1. What is an expression? A fragment of code that produces value
  2. What is a binding? A tentacle that catches and holds values
  3. What is an environment? The collection of bindings and their values that exist at a given time
  4. What is a function? A piece of program wrapped in a value. Such values can be applied in order to run the wrapped program.
  5. Give an example of a function. Prompt (“enter passcode”)
  6. What is a side effect? ? Showing a dialogue box or writing text to the screen is a side effect .
  7. Give an example of a function that produces a side effect and another function that produces a value. Function Prompt produces side effect , function math.max produces value
  8. What is control flow? When you program contains more than 1 statement the statements are executed as if they are a story, from top to bottom.
  9. What is conditional execution? When the program takes the certain branch based on the situation at hand.
  10. What kind of keyword do you need to use to invoke conditional execution? The “if ” keyword
1 Like
  1. What is an expression?
  • Is a fragment of code that produces a value is called
  1. What is a binding?
    • To catch and hold values
  • 3. What is an environment?

  • The collection of bindings and their values that exist at a given time
  1. What is a function?
  • A function is a piece of program wrapped in a value
  1. Give an example of a function.
  • prompt(“Enter passcode”);
  1. What is a side effect?
  • Is a program that Showing a dialog box or writing text to the screen
  1. Give an example of a function that produces a side effect and another function that produces a value.
    • Side effect: console.log(Math.max(anything can say)); / prompt(…) / alert(…)
    • Value: console.log(Math.min (2, 4) + 100); // 102
  1. What is control flow?
  • Is a program that contains more than one statement the statements are executed as if they are a story, from top to bottom.
  1. What is conditional execution?
  • Is a program that not straight it create a branching road where it takes the proper branch based on the situation at hand
  1. What kind of keyword do you need to use to invoke conditional execution?
  • With ‘if’
1 Like
  1. An Expression is a Fragment of code that produces a Value. A Statement is made up of expressions. A Program is a set of statements from top to bottom.

  2. A Binding or Variable is used to assign a Value through the use of a Keyword such as let, var, or const

  3. A collection of Bindings and Values that exist at any given time is called an Environment.

  4. a Function is a piece of program wrapped in a Value. Such Values can be Applied in order to run the wrapped program. Executing a function is called invoking, calling, or applying it. Values given to functions are called arguments.

  5. prompt is a function.

  6. A side effect example would be the pop up box that appears on the screen from the prompt function.

  7. alert is a function that produces a side effect while console.log is a function that produces a value.

  8. Control flow is the direction in which a program with multiple statements is executed. A program executes from top to bottom like a book.

  9. Conditional execution is making a branching road in a program that executes based on a condition or value.

  10. Kewords if, while, and do, are used for conditional execution.

1 Like

1.What is an expression?
A. An expression is any value that is written

  1. What is a binding?
    A. Binding is how the program “remember new
    values, or “catches and holds” new values

  2. What is an environment?
    A. An environment is the collection of bindings and
    their values that exist at a given time

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

5.Give an example of a function.
A.Function prompt(“whats your name?”) shows a
dialog box requesting the users input for their
name.

  1. What is a side effect?
    A. An example of a side effect is showing a dialog box or writing text to the screen.

7.Give an example of a function that produces a side effect and another function that produces a value.
A. An example of a side effect function is prompt(“enter passcode”); an example of a function
that produces a value is console.log
(math.max(1,2));

8.What is control flow?
A.Control flow is the order of execution of more than one statement in a program. The execution runs from top to bottom, similar to a story being read.

  1. What is conditional execution?
    A. A conditional execution is a program that is execute only when certain conditions are met. The conditional execution is created with the if keyword
    in JavaScript***

  2. What kind of keyword do you need to use to invoke conditional execution?
    A. The keyword for conditional execution is “if”.

1 Like
  1. What is an expression?

  2. A fragment of code that produces a value.

  3. What is a binding?

  4. Catches and holds values after a binding has been defined it can be used as an expression.

  5. What is an environment?

  6. The collection of bindings and their values that exist at a given time.

  7. What is a function?

  8. A function is a piece of program wrapped in a value these values can be applied in order to run the wrapped program.

  9. Give an example of a function.

Prompt(“Enter password”);

Shows a dialog box asking a users input on website.

  1. What is a side effect?

  2. Showing a dialog box or writing test on the screen.

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

  4. Console.log(Math.max(2, 4));

  5. Value

Console.log(Math.min.(2, 4) + 100);

  1. What is control flow?

  2. Control flow or flow of control is the order in which instructions, statements and function calls being executed or evaluated when a program is running

  3. What is conditional execution?

  4. It allows one to execute certain parts of code depending on whether the condition is true or false, with the IF expression.

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

  6. The IF keyword

1 Like