Binding, Functions and Control Flow - Reading Assignment

  1. An expression = a fragment of code that produces a value.
  2. Binding is the way/thing that you catch and hold values, to keep an internal state within the program.
  3. The environment represents the collection of bindings & their values, at a given time.
  4. Function = a type of value (provided in the default environment) that once called it executes the wrapped program.
  5. Math.min
  6. A side effect is an additional effect that occurs due to function invoking (showing a dialog box, for example).
  7. Side effect function: prompt
    Value function: Math.max
  8. Control flow refers to the “chronological” order that a program is executing the statements, by default.
  9. Conditional execution = executing statements under certain conditions only. By programming conditional executions, the default control flow is overwritten.
  10. if
1 Like
  1. It is a fragment of code that produces a value. They can contain other expressions
  2. Bindings or variables are things for catch and hold new values, otherwise they will be dissipate.
    3.The collection of bindings and their values that exist at a given time is called
    the environment
  3. A function is a piece of program wrapped in a value. Such values can be applied
    in order to run the wrapped program (i.e, the function)
  4. alert (“good morning!”);
    6.They are a result of some functions.those functions are useful because of it. Although,There are functions that produce values in which cases there is no need of side effects to be useful
    7.side effect function
    alert (“good morning!”);
    value function
    console.log(Math.max(2, 4));
    // → 4
    8.the control flow determines the execution of the program when it has more than one statement, from top to bottom.
    9.it is an option to straight roads. Conditional execution is created with the if keyword in JavaScript. The program takes a road based on the stablished criteria (or lack of). It is based on a boolean expresssion.
    10.Conditional expressions: if and else.
1 Like
  1. An expression is a fragment of code that produce value.

  2. Binding is a place to catch or hold values ( binding or variable).

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

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

  5. alert(“I am new to Javascript.”);

  6. Showing a dialog box or writing text to the screen is a side effect.

  7. Function with a side effect.
    function mix_age(age) {
    let age = 4;
    let new_age = age * age
    }

Function without a side effect

Console.log(Math.min(2,3) + 50);

  1. Control flow is order in which the computer executes the script.

  2. Conditional executing is happening when we want to create a branching road, where the program takes the proper road based on the situation at hand.

  3. If keyword is need to use to invoke conditional execution.

1 Like

. 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. E.g., The simplest kind of statement is an expression with a semicolon after it.
    This is a program:
    1;
    !false;
    . What is binding?
    To hold things, to catch and hold values, JavaScript provides a thing called binding or variable:
    let caught = 5 * 5; Let registers that this sentence is going to define binding. After a binding has been defined, its name can be used as an expression. (Var and const can be used similar to let create binding, similar to let )

What is an environment?

  • The group of bindings and their values that exist at a given time is named the environment.

What is a function?
A function is a piece of a program wrapped in a value, these values can be applied to run the wrapped program.
E.g inside a browser environment, the binding prompt holds a function, that shows a small box, asking for user input.

Give an example of a function.

  • prompt(“Enter passcode”);

What is a side effect?
Showing a dialog box or writing text to the screen is a side effect.

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
  1. 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.
  1. What is conditional execution?
    if keyword in JavaScript. In the
    simple case, we want some code to be executed if, and only if, a certain condition
    holds.

  2. What kind of keyword do you need to use to invoke conditional execution?
    If else

1 Like
  1. An expression is when letters or numbers get operations to produce a value.
  2. Binding is when you bind a word or a number to a value. The element that was bind is remembered until you replace what it is that it remembers.
  3. An environment is a collection of bindings that are saved. Every new program contains an environment of standard bindings.
  4. A function is a piece of program wrapped in a value.
  5. Prompt(" "); brings out a a dialog box with text.
  6. A side effect is when a function produces a dialog box or text on the screen. Side effects can be very useful.
  7. Prompt(" "); produces a side effect because it brings out a dialog box.
    math.max(2,4); brings out 4 which is a value.
  8. Control flow is when the program contains more than one statement.
  9. Conditional execution is when there are more than one road of where the programming will go. It will go depending at what will happen to the programming.
  10. If is the keyword used to invoke conditional execution.
1 Like
  1. What is an expression?
    A fragmented code that produces a value. An expression within parenthesis is an expression.

  2. What is a binding?
    a mode that catches and holds value

  3. What is an environment?
    The collection of bindings and their findings that exist at given time

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

  5. Give an example of a function.
    alert (“I am the man”)

  6. What is a side effect?
    Showing a dialog box or writing text to screen is a side effect. A statement stands on its own, so it has value only when it is affecting the world. When the statement affects what is seen on the screen or if it affects something internally inside the machine and how it operates.

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

side effect example = Prompt(“Enter your birthday”)

value example =

  1. What is control flow?
    control flow is the order from which we code and have our statements evaluated

  2. What is conditional execution?
    when a condition is only executed when it meets predefined condition

  3. What kind of keyword do you need to use to invoke conditional execution?
    if, if else, while, loop, true/false

2 Likes
  1. Any piece of code that produces a value is an expression.

  2. Binding is to give a name or variable a value, for later use.

  3. An environment is the set of variables and thier values that exist at a given time.

  4. A function is a block of code with a given name and can be executed at anytime.

  5. Prompt(“Enter password”);

  6. A side effect is when a function produces a dialogue box or display text on the screen.

  7. a) Prompt("");
    b) Math.max(5,8)

  8. It’s the order in which how statements are executed.

  9. It’s when the program takes an alternate route based on certain condition.

  10. If.

3 Likes
  1. An expression is a value from fragmented code. Written literally; in parenthesis is an expression. Binary operator for 2 expressions, unary operator for 1 expression, and can build complex computations. A JS statement corresponds to a full sentence; a language based interface including sub-sentences followed by semicolons.

  2. A binding has “catch and hold” features maintaining internal status, memory and production of new values from old values while not changing the old values. New values have to be used immediately or lost. To do this JS provides binding. Keyword, “let” is an indicator that the sentence is going to define a binding, name of the binding, and value by an = operator and an expression. When a binding points to a value it is not tied to that value forever. When the result does not have a value JS designates the value “undefined.”
    Var and const are also keywords.

  3. An environment is a collection of bindings and their values at a given time. Much like paragraphs are made of sentences, environments are made of bindings. Bindings provide ways to interact with the surrounding systems including reading of mouse and keyboard inputs.

  4. A function is a repeatable block of code that executes actions and tasks; executes by requests (to invoke), and causes something to be carried out. The value of a binding is a function and is the definition of a function, the essence of JS programming.

  5. An example of a function:
    Var myFirstFunction = function(){
    console.log(“hello world”);
    };

  6. Side effects stand on their own and do not have to amount to much. If they do amount to much, “change the world,” they are called side effects. They may change the internal state of the machine to affect the next statement. In some cases the semicolons can be omitted at the end of a statement. Usually semicolons are needed to keep the next statement from becoming part of the same statement.

  7. Example of function with side effect:
    const saySomething = function() {
    console.log(“I love you!”);
    };
    function with a value:
    ‘half of 50 is ${50/2}’
    25

  8. Control Flow is JS programming statements are the pathways of coding language, and structuring of functions. It is a possible course of action arising from decisions and the attributes of control and flow of actions and tasks. “If” is a control statement. “Then” is the path to the desired flow.

  9. Conditional execution programming is more complex in that some code is to be executed if and only if, a certain condition holds true… sometimes called situational or situational dependency programs. Keyword Let and “If,” if it is true then…, or else. The program checks the statements closely following branches of statements, condition by condition until truth statements are matched. The function body goes between curly brackets.

  10. Invoking conditional execution uses key words, “let,” to define the binding, “If” and the expression following is written between parentheses, and else, in braces and semi colon after each conditional statement of “else if” and “else” the terminology of conditional execution.

2 Likes
  1. Expression is a task in programing
  2. Binding is a name for an variable or function
  3. Environment is where you put all your programing
  4. A function is a sequence of expression to do a specific work in programming
  5. function Math.max(2, 5);
  6. If a statement or function modifies the state of something else (outside its own scope), then it is
    producing a side effect.
  7. side effect:
    let temp = 0;
    function check(){
    return temp;
    }
    value:
    function addToOne(x){
    return x+1;
    }
  8. Control flow is the direct the program executing be controlled by some conditions.
  9. The execution only be executed when the condition met.
  10. if else
2 Likes
  1. An expression is a simple piece of code that returns a value.
  2. A Binding or Variable a piece of code that you name which refers/points to a value that you set. ex let Five = 5;
  3. An environment is the overall collection of variables/bindings and their values.
  4. A function is a set of code that executes a specific instruction.
  5. prompt(“Do you want to add Milk to your cart?”);
  6. A side effect is an outcome of a function that affects the world outside of its function.
    7. Number(prompt("How many pizzas would you like to order?")); - This produces a side effect because it retrieves info from outside of the function/program. Console.log( 6 * 10); Does not produce a side function since it is only interacting within the program and not retrieving data from outside itself.
  7. Control Flow is the order of how your code is executed.
  8. Conditional Execution is when you have a condition that has to be met in order for your code to be executed.
  9. If, Else, Else if, While, True, False
2 Likes

It’s getting more difficult which each lesson. After a work day feel so not focused on the reading assignment …and answering the quiz. I guess i will spend more time for each lesson , maybe only in weekends . Remember, before this Academy , I never coded anything in my 40 years of life :))) . I am asking you now , guys, the completely beginners like me , how is it for you , how can you make peace between a full time job of 12 hours daily and the lessons ?

2 Likes
  1. What is an expression?
    a fragment of code that produces a value
  2. What is a binding?
    a thing that holds a value, a variable
  3. What is an environment?
    a collection of all the bindings and their values available at a given time
  4. What is a function?
    a function is a small chunk of code that has a name or value, that be invoked by other code
  5. Give an example of a function.
    function add(x,y) {
    x + y;
    }
  6. What is a side effect?
    an observable change to the world caused by a statement
  7. Give an example of a function that produces a side effect and another function that produces a value.
    prompt(“hello world”) produces a side effect of a dialog box
    Math.max(2, 4) produces the value “4”
  8. What is control flow?
    the order in which a program is executed
  9. What is conditional execution?
    where a program decides which path to take based on certain conditions being met or not
  10. What kind of keyword do you need to use to invoke conditional execution?
    if, else, or else if
3 Likes
  1. What is an expression?
    A fragment of code that produces a value is called an expression.

  2. What is a binding?
    To catch and hold values, JavaScript provides bindings , or variables. 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

  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.
    For example, in a browser environment, the binding prompt holds a function that shows a little dialog box asking for user input.

  6. What is a side effect?
    A function should produce a return value. Any application state change that is observable outside the called function other than its return value is called a side effect. 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: alert(“hello world”);
    Value: console.log(Math.max(2, 4));

  8. What is control flow?
    Control Flow: When you have more than one statement, CF is the order in which the statements will be evaluated and executed. In Javascript, code is run top to bottom.

  9. What is conditional execution?
    Conditional execution: code is only executed when it meets a predefined condition.

  10. What kind of keyword do you need to use to invoke conditional execution?
    “If”, “Else”, “Else If”.

3 Likes

Difficult situation and may be shared experience by others. Have you talked with a counselor? A chat with a counselor might help with suggestions.That has been my help. Also, checking in daily even if only 15 minutes, or reviewing a new session several times. Learning anew requires repetition, even if only a short session daily… Plugging along pays in the long run. Great luck to you in your pursuits of learning this!

3 Likes
  1. A fragment of code that produces a value is called an expression.
  2. Binding could be imagined as “tentacles” rather than boxes.
  3. The collection of bindings and their values that exist at a certain time is called an environment.
  4. A function is a piece of program wrapped in a value.
  5. Example of a function : prompt(“Enter passcode”);
  6. Showing a dialog box or writing text to the screen is a side effect.
  7. The function : Math.max(2,4) produces a value.
    The function : prompt(“Enter passcode”); produces a side effect.
  8. The control flow is a program that contains more than one statements and the statements are executed as if they are a story , from top to bottom.
  9. The conditional execution means that we want a code to be executed if and only if a certain condition holds.
  10. In order to execute a conditional order in JavaScript we use the keyword : if.
2 Likes

Thank you , Lorraine , for the kind words. I never stop learning, I won’t stop now . It’s just , sometimes , everything looks like learning Chinese :)))). But , i continue . Technical analysis and trading was much easier for me to learn and apply. Have a great weekend !

3 Likes
  1. An expression is a fragment of code that produces a value
  2. A binding is a variable that catchs or holds value
  3. An environment is 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. An example of a function that shows a dialog box for user input password is
    promt(“Enter Passcode”);
  6. A side effect is a statement result observable outside the called function that changes the value
  7. prompt(“Enter passcode”); has the side effect of prompting a user input dialogue box
    console.log(Math.max(2,4)); produces a value
  8. The control flow is the order of executing code from top to bottom
  9. Conditional execution is when we use if to execute code when certain conditions are met
  10. The keyword used to invoke conditional execution is ‘if’
2 Likes
  1. What is an expression?
    An expression it is a fragment of code that produces a value.
  2. What is a binding?
    To catch and hold values.
  3. What is an environment?
    An environment is the set of bindings that are defined.
  4. What is a function?
    Functions are special values that encapsulate a piece of the program.
  5. Give an example of a function.
    prompt(“Enter passcode”);
  6. What is a side effect?
    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.
    prompt(“Enter passcode”); has the side effect of prompting a user input writing text
    console.log(Math.max(2,4)); produces a value
  8. What is control flow?
    Control flow is the order of executing code from top to bottom.
  9. What is conditional execution?
    Conditional execution is when the programmer uses “if” to execute code when certain conditions are met.
  10. What kind of keyword do you need to use to invoke conditional execution?
    “if”
2 Likes
  1. piece of code that produces a value
  2. it´s like string that binds into a value. Can have multiple values
  3. collection of bindings and their values.
  4. piece of code wrapped in in a value
  5. alert
  6. Showing a dialog box or writing text to the screen is a side effect.
  7. alert will cause a side effect, console.log(Math.max(5454554, 989898998)); will give a value
  8. Control flow is the order in which we code and have our statements evaluated
  9. Conditional Execution is a branch in the control flow’s execution, where JavaScript picks a branch depending if the conditions that are present.
  10. if or else
2 Likes

An expression is a piece of code that returns a value.
Here’s an example of an arithmetic expression is:
10+14; //—>Produces the numeric value 24

And here’s an example of a string expression:
‘hello’; //—> returns the string ‘hello’
'hello ’ + ‘world!’; //—> returns the string ‘hello world!’

And here are some examples of logical expressions:
10 > 9; // returns boolean value true
10 < 20; // returns boolean value false
true; // returns boolean value true

A binding, also a variable, is what is used for the computer to remember data and not just discard it after it’s used. A binding is how Javascript catches and holds values so that they can be used again and again. For example, the keyword let tells the computer that a binding is being defined. in the following example code, the binding is called caught and it is being used to catch and hold in memory the value produced by 5 * 5.
example:
let caught = 5 * 5;
console.log(caught);
//—> 25

another binding example:
let six = 6;
console.log( six * six);
//—> 36

An environment is a collection of bindings (or variables) and their values that exist in a digital space at a particular time. There are different kinds of environments which are used to: create to simple text files, communicate with a computer’s operating system, interact with a program, develop software, hardware, games, etc and more.

A function is a chunk of organized and reusable code that is wrapped in a value to perform a particular action. For example, when the the prompt function
is run, a pop-up dialog box will appear in the browser and asks the user for some sort of input.
In the following example, the prompt functions ask for a user’s name:
prompt(“Enter your email”);

A side effect is statement that leaves an impression in the environment rather than ceasing to exist after it is run. Examples of side effects are when something is displayed on the screen or when the internal state of the machine is changed in a way that affects that statements that comes after it.
The prompt function produces a side effect when it displays the pop-up dialog box.

An example of a function that returns a value is the Math.max function which takes any number of arguments and outputs the greatest number like the following example:
console.log(Math.max(5, 10);
//—> 10
or
console.log(Math.max(5, 10) + 60);
//—> 70

Control flow refers to how the computer executes a program from top to bottom as if it is telling a story. When there are a number of statements the programs runs from the beginning to the end of the statements.

Conditional execution controls the behavior in JavaScript and determines whether or not pieces of code can run. This type of execution happens when we want code to be performed only if certain conditions are met.
In Javascript, the keyword if is used to create a conditional like in the following example:
if (2 + 2 == 4) console.log(“It’s true!”);
//—> It’s true!

2 Likes