Binding, Functions and Control Flow - Reading Assignment

  1. An expression is any piece of code that evaluates to (produces) a value. It can be as simple as a single primitive value, or a more complex interaction of values, operators and sub-expressions; a function can also be an expression when it is assigned to a variable name.

  2. A binding (or variable) is any value or expression which has been assigned to a name (effectively labelled) in order for it to be stored in the computer’s memory, and then accessed and reused by the program whenever required. A variable is defined using the keyword   let ,  const ,  or   var ,  followed by its chosen name (identifier). Unless it is an empty variable, the value is assigned (tied/bound) to the variable’s name using  =   (the assignment operator)  e.g.

      let myVariable = a && b / 100;

    The stored expression (or value) can be accessed with the variable’s name, which now
    effectively represents it. However, the assignment of an expression (or value) to a name
    does not have to be permanent, and can be reassigned (replaced with another) at any
    time — except with variables defined with  const .

  1. An environment is made up of all the bindings which are available for a program to access. As well as bindings defined within the program itself, an environment also includes a large pre-defined set of bindings, which either come already built-in to the JavaScript language, or are available in a particular environment (for example in a browser). This pre-defined set of bindings includes many standard functions which do not need to be programmed from scratch before they can be invoked (with their function names) to perform specific tasks or computations.

  2. A function is a reusable “mini-program” placed within a value. The code of this mini-program will have been written to perform a specific task or computation, and will execute each time the function is called (invoked) with its name (the one it has been assigned to) appended with parentheses. The parentheses contain any required arguments — values fed into the function as parameters, and needed for the function to execute successfully.

  3. An example of a function:

       prompt("Enter your user number");

       prompt             function name (binding name)
       prompt();          function call
       "Enter...number"    argument

  1. A side effect is some kind of meaningful action produced by a piece of code (such as a function), and which occurs externally (outside of the program).

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

       console.log("Hello, world!");

    // "Hello, world!" printed to the browser's console.

    An example of a function that produces a value:

       Number("9");

    // returns 9 as a number type (converts a string to a number type)

       Number("string");    // returns NaN
  1. Control flow is writing code that enables the computer to correctly decide which path to take through a program. In other words, having executed one statement, the program’s control flow will tell the computer which statement to execute next. For example, a program’s control flow could result in (i) one of two or more alternative branches being taken (conditional execution), which therefore leads to some statements being omitted, or (ii) a specific code block being repeated many times over (iteration).

  2. Conditional execution is where the program’s control flow presents a Boolean expression and, depending on whether this expression evaluates to the Boolean value  true  or  false  (i.e. whether the condition is met or not), only one of two alternative branches of code will be executed next. Where a series of consecutive Boolean expressions are used, only one of several alternative branches will end up being executed.

  3. Keywords used to invoke conditional execution:

        if         /* precedes the 1st (or only) condition (the Boolean
                      expression in parentheses) */

        else if    /* precedes any further Boolean expressions (in a series
                      of consecutive conditions) */

        else       /* precedes the statement or code block to execute if the
                      Boolean expression (or final Boolean expression in a
                      series) evaluates to false */
1 Like

1.An expression is a piece of code that produces a value

2.Binding is a way to catch and hold value , let, var or const

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

4.Function is a piece of program wrapped in a value

5.the best example of a function is a dialog box that is asking for some input

6.A side effect is viewable side of a function, a dialog box or writing text on a screen

7.console.log is a side effect, visable and math.min function produces a vale

8.Control flow is the way in which the program is read and then executed, it flows from top to bottom

9.Conditional execution is a way to move from one part of the JavaScript code to another provided certain conditions are met

10.Conditional execution are , else if used with Booleans ( true/ false )

  1. A fragment of code that produces a value
  2. A binding is a sort of tentacle which grasps information. Multiple bindings can point to the same value.
  3. 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 (reserved word).
  5. prompt (“Type something”);
  6. When something observable happens.
  7. alert(“side effect”);, console.log(1<2); returns boolean value
  8. Control flow is the directional top to bottom execution of a program.
  9. Conditional execution means taking the proper branched road based on a situation at hand.
  10. The “IF” keyword.

An expression a fragment of code that produces value.

Binding is a function that catches and holds value.

A collection of bindings is called and evinronment.

A function is a piece for program wrapped in value.

prompt(“Enter passcode”);

showing a dialog box on the sreen is a side effect.
console.log(Math.max(2, 4)); // → 4
console.log(Math.min(2, 4) + 100); // → 102

Control flow is the process of executing statements in proper sequence.

Conditional execution is when we want to execute a specific part of a program based on a specific condition Boolean expressions.

The control word is “IF”

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

  2. What is a binding?
    A binding acts as a pointer to a value stored in memory.

  3. What is an environment?
    An environment is a collection of bindings that exist at any given time.

  4. What is a function?
    A function is a small program which is wrapped in a value. If you bind a function to a variable you effectively assign the value returned by that function.

  5. Give an example of a function.
    function myFunction(){return myValue;}
    let myBinding = myFunction();

  6. What is a side effect?
    A program can produce outputs which display and output or change the internal state of a machine in a way that could affect statements that come after it.

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

produces a value.
console.log(“Message to be displayed.”);

function doubleValue(singleValue){
return singleValue * 2;
}
set myValue = doubleValue(2);

  1. What is control flow?
    Program statements are generally executed in a top down fashion, which is known as control flow.

  2. What is conditional execution?
    Conditional execution interrupts and changes the flow control by using a conditional statement to decide if subsequent statements are to be executed.

  3. What kind of keyword do you need to use to invoke conditional execution?
    The ‘if’ keyword is used in conjunction with comparison operators to decide the execution of subsequent statements. The ‘if’ keyword becomes even more powerful when used in conjunction with the ‘else’ keyword as this then allows for any number of optional statements to be executed.

  1. What is an expression?
    A piece of code that produces a value
  2. What is a binding?
    The Let, Var, or Const keywords are used to define a binding (Any word can be a binding unless it
    is a keyword)) by using the = operator followed by an expression. A binding is stored until it is
    redefined in the console.
  3. What is an environment?
    The collection of bindings that exist at a given time
  4. What is a function?
    Part of a program wrapped in a value
  5. Give an example of a function.
    prompt (“enter a number”)
  6. What is a side effect?
    An expression that causes changes to the internal code that can cause errors
  7. Give an example of a function that produces a side effect and another function that produces a value
    Example 1. prompt (“enter a number”) 2. Console.log (math.min(6,9)*10);
  8. What is control flow?
    The order of the executed code.
  9. What is conditional execution?
    Using the if keyword to specify certain conditions in the code that changes the control flow.
  10. What kind of keyword do you need to use to invoke conditional execution?
    If, else, else if
1. What is an expression,
    a piece of code that produce a output of some sort.
   
2. What is a binding,
    assigning a value to a variable or function
   
3. What is an environment,
   collection of bindings or variables and their values that exist at a given time
   
4. What is a function, it’s a block of code which can take parameters as input and return a value or result of a calculation of some sort in the actual function block.
   
5. Give an example of a function,
    if you need to covert a temperature from Celsius to Fahrenheit, you can call this function with Celsius as parameter and do get the Fahrenheit as a return value. alert(“This is an simple example of a function”)?
   
6. What is a side effect,
    a function that return something ie. console.log(‘side effect of this function’) 
   
   
7. What is control flow.
   It the way execution goes, from top to bottom so you can’t call a variable before it’s declared or bind:ed.
   
8. What is conditional execution.
   It’s when you create different choices for the program to execute, if it’s raining (get you umbrella) else (no umbrella today) 
   
9. What kind of keyword do you need to use to invoke conditional execution.
   If,then,else
  1. An expression is a piece of code that produces a value.
  2. Binding is the association of code or data with an identifier in a programming language.
  3. An environment is a collection of variables and their values that exist at a given time.
  4. A function is a piece of code that does something useful.
  5. An example of a function is a piece of code that adds numbers together and returns the sum total.
  6. A side effect is a function or expression that modifies some state or makes an observable change when calling functions to the outside world (in addition to returning a value).
  7. An example of a function that produces a side effect is the alert function that creates a dialog box with a message. An example of a function that produces a value is one that adds numbers together and returns the sum total.
  8. Control flow is the order in which individual statements, instructions, or function calls are executed or evaluated.
  9. Conditional execution is the execution of part of the program code only when a certain condition is true.
  10. Conditional keywords, such as if, else, else if.
  1. Expression is a fragment of code which produces a value
  2. Binding is a statement which allows you to hold a previously added values
    3)Environment is a collection of values and bindings in current timeframe.
    4)A function is a piece of program wrapped in a value
  3. prompt(“Enter password”);
    6)Showing a dialog box or writing text to the screen is a side effect.
    7)alert (“this functions produces a side effect”)
    console.log (2+2); produces a value
  4. It this the execution flow in Javascript, which goes from top to bottom (as we read)
    9)A point when a program decides what to do based on a certain conditions
  5. “if”
  1. A fragment of code that produces a value is called an expression

  2. A keyword piece of computer memory containing some information inside

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

  4. A function is named section of a program that performs a specific task

  5. alert(“insert yo moma joke here”)

  6. Side effect is a statement result that changes something that affects the program

  7. prompt(“Enter your name”);

let thenumberthree = 2;

  1. The code getting executed in order from top to bottom or like going in a straight line

  2. When the flow doesn’t go in a straight line depending on the condition and statement given

  3. if and else

  1. What is an expression?
    Every value that is written literally is an expression.

  2. What is a binding?
    Variable to catch and hold value.

  3. What is an environment?
    The 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.
    prompt(“Enter passcode”); (in a browser environment)

  6. What is a side effect?
    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.
    console.log(“hello world”);
    console.log(Math.max);

  8. What is control flow?
    When your program contains more than one statement, the statements are
    executed as if they are a story, from top to bottom.

  9. What is conditional execution?
    When we want the program to take the proper branch based on the
    situation at hand

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

  1. Code that produces an expression.
  2. Another word for a variable or something that stores a value for later.
  3. The collection of bindings and values.
  4. A piece of program that will execute a statement based on given values.
  5. console.log()
  6. A side effect is a statement that produces a change for the future as opposed to just a value that will be discarded immediately after.
  7. prompt(“Enter passcode”); would produce a side effect while console.log(1+2); would give just a value.
  8. It’s the order statements are executed.
  9. It’s how the flow of statements can change depending on different results given from previous statements.
  10. You need to use “if”

1.What is an expression?
Every value that is written literally is an expression.

2.What is a binding?
A binding is a value or string set to a variable.

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.

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

6.What is a side effect?
Showing an alert or dialog box.

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

promt(" My man");
console.log(3+3);

8.What is control flow?
The way that code is evaluated.

9.What is conditional execution?
Code will be executed only on specific conditions.

  1. What kind of keyword do you need to use to invoke conditional execution?
    if; else; else if;
  1. A fragment of code that produces a value is called an expression.
    2 A binding is a value or string set to a variable, it helps to make bindings so you don’t have to write out the same expression multiple times in the program.
    3 The collection of bindings and their values that exist at a given time is called
    the environment.
  2. A function is a piece of program wrapped in a value.
  3. alert(’‘I am blockchain expert’")
  4. Showing a dialog box or writing text to the screen is a side effect.
  5. prompt(’’ enter lucky number") has side effect
    console.log(Math.max(9, 81)); it produces a value.
  6. It is the direction of execution of code in JavaScript which happens in a top down approach.
  7. Conditional execution is used when a website has input from a user, it allows the program to behave differently based on different information being entered or manipulated by the user.
  8. if and else.
  1. In coding an expression is a combination of valid code that resolves to a value.
  2. Binding is assigning one thing to values
  3. environment is a set of processes and programming tools used to create a program
  4. A function is a name of a section of a program that performs a specific task
  5. print(“Hello World”)
  6. A side effect is when a procedure changes a variable from outside its scope
  7. int a = 5;
    int square(int number)
    {
    a = a*a;
    return a;
    }
    a = square(a);
  8. Control flow is the order in which procedures of a program are executed/evaluated.
  9. Conditional Execution is the specific argument that must be followed for a procedure to execute.
  10. The keywords used to invoke conditional executions are if,else, and when.
  1. What is an expression?
    An expression is any fragment of code that produces a value.

  2. What is a binding?
    A binding is like a variable in that it catches and holds values.

  3. What is an environment?
    An environment is a collect of bindings and their values which exist within a program.

  4. What is a function?
    A function is a piece of program wrapped in a value. That value is applied to run the wrapped program.

  5. Give an example of a function.
    The function console.log outputs is arguments to the JavaScript console.

  6. What is a side effect?
    A side effect can be produced as a result of running a function like 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.
    The prompt function produces the side effect of a dialog box. The Math.min function takes any amount of number arguments and returns the smallest value.

  8. What is control flow?
    For a program with multiple statements the control flows is such that each statement is executed in order from top to bottom.

  9. What is conditional execution?
    Conditional execution is when a program can take any one of two or more branches of statements depending on the present situation.

  10. What kind of keyword do you need to use to invoke conditional execution?
    The if keyword is used to invoke conditional statements.

  • What is an expression?
    is a fragment of code that produces an expresiion
  • What is a binding?
    is a variable created within a given program
  • What is an environment?
    a collection of bindings and values that exist at a given time
  • What is a function?
    expression wrapped in a value
  • Give an example of a function.
    console.log is a function
  • What is a side effect?
    where a procedure changes a variable outside of its scope
  • Give an example of a function that produces a side effect and another function that produces a value.
    console.log (a) is a side effect
    a value maybe Let a = 10
  • What is control flow?
    is the order of which the statements are executed
  • What is conditional execution?
    is part of a program where some of a condition is met
  • What kind of keyword do you need to use to invoke conditional execution?
    if, else, and else if
    [/quote]

happy new year!

I came here by Business Masterclass. I think the link is not correct.

I just read an article by careerfoundy about back and frontend but the answer below and the question above are too detailed and are NOT yet adressed in this article.

https://careerfoundry.com/en/blog/web-development/whats-the-difference-between-frontend-and-backend/

What is an expression?

A piece of code once computed provides a value.

What is a binding?

It is the way in which a program can recall a value or values derived from an expression with the intent to use that value without having to recalculate the way in which the value was determined. Also known as a variable.

What is an environment?

A group of bindings with their associated values .

What is a function?

Functions are a combination of statements that perform a specific task or to calculate a value

function course (code) { console.log ("Learning" + " " + code); } course ("JavaScript");
Output:  Learning JavaScript

What is a side effect?

When a returned value is other than the intended value expected from the computation.

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

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

What is control flow?

Programs that have multiple statements need to be resolved in hierarchy type fashion, top to bottom in order for a natural flow.

What is conditional execution?

This type of execution can only be implemented when the condition for its execution are met.

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

(If)

1: A fragment of code that produces a value.

2; Binding or variable is used to catch and hold values, making the program remember things

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

4: A function is a module of code that accomplishes a specific task. A function usually takes certain data as input, processes the data, and returns the result.
5: Function add (a, b) { return a + b; }
6: Side effects happen when a statement changes the environment
and affects the statements that come after it.
7: alert(“Hi”);
console.log(2*4)
8: When your program contains more than one statement, the statements are executed in the stored order, top to bottom
9: Conditional execution is the way that programs take the proper branch based on given instructions.
10 if, else