- What is looping control flow allowing us to do?
Looping control flow allows us to go back to some point in the program where we were before and repeat it with our current program state. - Describe what “loops” do in your own words.
Loops can look for the answer to a boolean. It does irritations until it finds an answer. - What is the difference between while and do-loops?
a do-loop will run once wether the condition is true or false and the while loop will do as much irritations it needs to either succeed and answer or not. - What is indentation?
Indentation is organizing the statements in the code so that it is easy to read, identify, and see where are new blocks connected to each other. Everyone has their own way of dividing, putting spaces before statements in the code but in the end the computer would read a straight one line of code.
going back in the code to run it multiple times.
a successive entered expression which holds true (boolean) until completion of the last loop.
while-loop doesn’t have to be executed, if value is boolean-false from start.
a do loop will always be executed once.
-
indentation is used to make code better recognizable by structure/shape
-
What is looping control flow allowing us to do?
To go back to some point in the program where we were before and repeat it with our current program state. -
Describe what “loops” do in your own words.
A tool that developers can use to run certain code multiple times. -
What is the difference between while and do-loops?
The difference between the two is that a do-loop always executes its body at least once, and it starts testing whether it should stop after the first execution. -
What is indentation?
The structure used to make code stand out.
Good answers, @Gabrielita
Just be careful with the names of the two different loops: it’s not “do while”, it’s:
- while loop; and
- do loop
Hi @LAVATOR.
Nice answers
Yes… AT LEAST once — it could run more than once if the condition after the code block is met.
… and that could be no loops at all if the condition fails at the very beginning
-
Looping Control flows allows the for the program to go back in its code and repeat a given function with the current program state.
-
It is the repetition of a specific process until the conditions of the program is met.
-
While loops first check the condition of the program before executing a code, do loops simply just executes a code if the conditions are true.
4.Indentions are not need but for more complex codes it helps keep the program structurally neat so there’s less chances for errors.
Hi There,
im reading the Eloquent _JavaScript.pdf Has anyone tested this function? can you explain please the results?
It’s wrong… but why? it should not output 14 as is greater than 12, right?
thanks in advance.
a
let number = 0;
while (number <= 12) {
console.log(number);
number = number + 2;
}
VM55:3 0
VM55:3 2
VM55:3 4
VM55:3 6
VM55:3 8
VM55:3 10
VM55:3 12
14
-
What is looping control flow allowing us to do?
To repeat an execution of code in a block, until a condition is met. -
Describe what “loops” do in your own words.
Loops are programming structure that allows to execute instructions within the structure, until the condition is met, or a if a break is present in the code. -
What is the difference between while and do-loops?
the difference is that the do loop will at least execute once, where the while loop will execute only if a condition is met. -
What is indentation?
It’s a way to make a clear reading of the code. It’s part of best practice, it makes easy reading.
- What is looping control flow allowing us to do?
- It allows us to go back to a prior point in a program and repeat with our current program state.
- Describe what “loops” do in your own words.
- Allows you to repeat a block of code until a condition is satisfied.
- What is the difference between while and do-loops?
- A while loop runs until an expression produces a value that gives true when converted to Boolean; that means a while loop could be complete before even going through the loop. A do-loop will always run through its body at least once.
- What is indentation?
- Spaces in front of lines of code. It’s best practice to use indentation for structuring code, but spaces are not required—the computer will accept the program just fine without them.
1 - What is looping control flow allowing us to do?
Looping control flow allows us to go back to some point in the program where
we were before and repeat it with our current program state.
2 - Describe what “loops” do in your own words.
A loop is a section of code that executes, line by line, until the last line of the section is reached and executed. This is called an iteration. Once this iteration is complete the code jumps back to the first line of the section to re-execute it again.
3 - What is the difference between while and do-loops?
do-loops will execute at least one iteration before the loop’s conditon is tested.
while-loops will test the condition first, and if true an iteration is completed.
4 - What is indentation?
An indentation is two or more white spaces appended to code section, in order to present the code file more readable.
1: Looping control flow allows us to have a program execute itself multiple times, preferably yielding different, useful results after every execution.
2: Loops are part of a program structure that does the same thing over and over, so that programmers don’t have to write big piles of redundant code.
3: Do loops differs from while loops by always executing once, no matter what. Then, it checks whether or not it should run again, but it always runs at least once.
4: Indentation is the structure of the code. Good structured code can be much easier to read and work with than bad structured code, although the program will understand and execute no matter how beautiful your program is.
Looping control flow allows us to repeat some lines of code as many times as needed until some condition has been met. Loops allow us to repeat snippets of code.
Loops do the boring repetitive stuff that computers excel at, unlike us error-prone humans.
While loops execute as long as some condition holds true. Do-loops are executed at least one time and then as long as some condition remains trues.
Indentation gives the code some structure making it easier to see the code sections at a glance. Reading code is easier if a top-down alignment is made so that the beginning and end of nested loops and functions are more visible.
What is looping control flow allowing us to do?
It allows us to go back to some point in the program where
we were before and repeat it with our current program state
Describe what “loops” do in your own words.
Lets us run a piece of code multiple times
What is the difference between while and do-loops?
statement starting with the keyword while creates a continuous loop. A do loop executes its body at least once, and it starts testing whether it should stop only after that first execution satisfies the condition
What is indentation?
indentation is used to make the structure of the code stand out
Hi @angieww,
If you run this in the console, the final number will be the value stored in the variable number
when the loop is finally exited. The final loop logs 12 to the console, but at the end of the final loop, 2 is added to the variable number
, making it 14. It is 14 which then fails the condition and prevents a further loop from executing.
14 <= 12
// => false
So the final output logged to the console is 12. But the variable number
now stores 14.
I hope that makes it clearer
Good answers @Yoshi
I think you made an unintentional slip here…the while loop runs until the conditional expression evaluates to false
(not true
).
Thank you so much for your educative reply, much appreciated.
Best regards
Angie
-
What is looping control flow allowing us to do? allows us to go back to some point in the program where we were before and repeat it with our current program state.
-
Describe what “loops” do in your own words. It’s a way to run a piece of code multiple times, so my understanding is that looping makes the code more efficient?
-
What is the difference between while and do-loops? In ‘while’ the given condition is checked at the start of the loop if the condition is false the loop is not executed, only when the condition is true the loop is executed.
-
What is indentation? To make the structure of the code standout.
- A looping control flow allows us to go back to some point in the program where we were before and repeat the block of code with our current program state
- A loop is a repeat of a block of code. It allows the same operation to be performed again and again - after each state change - until certain conditions are met.
- A while loop enters a statement repeatedly until the expression produces a value that is false when converted to Boolean. A do-loop forces the user to do some kind of action - it keeps executing the block of code until it gets a value that is not an empty string.
- Indentation is an optional but useful way of writing code. It helps developers see where one block ends and another begins (the visual shape of a program corresponds to the shape of the blocks inside)
1. What is looping control flow allowing us to do?
Looping control flow allows to go back to one point in the program and repeat it with the current state.
2. Describe what “loops” do in your own words.
Loops run a piece of code multiple times until a certain condition is met that produces an outcome that stops or breaks the loop.
3. What is the difference between while and do-loops?
A do loop executes its body at least once and tests if it should stop only after the first execution. Whereas a while loop could potentially not be executed at all, if it doesn’t meet the required condition.
4. What is indentation?
Indentation makes the structure of a code more visible and stand out. It doesn’t influence the execution itself, but makes it more readable and structured for the programer For example 2 spaces could be used between each block to make it more readable.
- What is looping control flow allowing us to do?
to take statements that are made up by values and make them into numbers. Update: Generally it means to control the flow of statments when doing loops. Contriol so we can go from point a to point b.
- Describe what “loops” do in your own words.
Looping allows us to be more efficient. Instead of writing out everything by hand over and over again. You let the computer do it really fast.
- What is the difference between while and do-loops?
a keyword that writes with the word WHILE creates a begining of a loop loop.
- What is indentation?
Making a code more structural so people can understand it, differ it from other code and read it more easily.