Loops
Coding and Collaboration
What's the Output?
Describe the code
Coding Best Practices
100
Is a loop used for sequence, selection or iteration? 

iteration

100

True or False: Most developers work independently with no help or collaboration

False

100

What does this log?

 var a = 2;
 a = a + 3;
 console.log(a);


5

100

How do you declare a variable called car?

var car;

100

Why should you run your code often?

To catch mistakes/ errors

200

What are the two types of loops you've learned about?

for and while

200
Two slashes as the beginning of a line "//" represent the start of a what?

Comment

200

What does this log?

 var name = "Sam";
 console.log("Hi " + name);


Hi Sam

200

Write code that prints the word "Done!" to the screen.

println("Done!");

OR

console.log("Done!");

200

Why should you indent your code appropriately?

Makes it easier to read

300

How many times does this loop run? 

 for (var i = 1; i <= 4; i++) {
       println(i);
 }

4 times

300
A comment should used to ___________ code

explain or describe

300

What does this log?

var color = "red";
console.log("The sky is " +color + "!");

The sky is red!

300

Declare a variable named i and initialize it with a value of 0.

var i = 0;

300

What is the best name for a variable that stores weight of your pet dog. x, dog, or dogWeight

dogWeight

400

What is the output?

var x = 0;
while (x < 2) {
    console.log("Hi");
    x++;
}


Hi
Hi

400

What does API stand for?

Application Programming Interface

400

What does this log?

for(var i=0; i< 3; i++){
     console.log("uno");

}

uno
uno
uno

400

How do you increment the value of variable count?

count++;

400

Every opening bracket should also have a corresponding

closing bracket

500

What is the output?

 for (var i = 0; i < 3; i++) {
    console.log(i);
}

0
1
2

500

Programming where two developers share ideas and work side-by-side is?

pair-programming

500

What's the output

var javascript = "programming";
println(javascript + " is fun");

programing is fun

500

Initialize and empty array called shoppingList

var shoppingList = [];

500

If a comment takes up multiple lines it's best to use what symbols for the comment?

/* comment here */