A statement that evaluates to true or false.
1) var Daniel = 3;
2) var Daniel = 5
3) console.log(Daniel);
What is wrong with this code?
You are creating the variable "Daniel" twice. There's a missing semi-colon on line 2.
1) number = 155%2;
2) console.log(number);
What does the console print out?
1
What is a function?
A function is a group of code that the computer is able to call again to reuse.
1) var result = getText("resultInput");
2) function result(){
3) setText("resultOutput", result);
4) }
5) result();
What is wrong with the code?
Both the variable and function share the same name, so the computer gets an error.
Which of the following is not an input detected by the onEvent?
a) change
b) click
c) scroll
c) scroll
1) var BenettsMood = "bad";
2) BenettsMood = "good";
3) What is BenettsMood equal to now?
"good"
var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
days[5]="Friday"
True or False?
True
What is a function call?
A line of code telling the computer to run the function again.
1) var RobertsMotivation = 0;
2) console.log("Robert gets a gift!");
3) console.log("It boosts his motivation up 5.");
4) RobertsMotivation = RobertsMotivation + 3;
What's wrong?
The computer is adding 3 instead of 5 to the variable "RobertsMotivation".
How do you update a variable?
You make a counter pattern.
What is a Syntax Error?
When your code does not follow the rules of the programming language.
1) var MsCasciasHappinessThroughoutTheDay == 100;
2) console.log("She remembers she has work! Her happiness goes down by 25.");
3) var MsCasciasHappinessThroughoutTheDay = MsCasciasHappinessThroughoutTheDay -- 25;
What's wrong with the code?
Creating the variable "MsCasciasHappinessThroughoutTheDay" twice. There are two equal signs on line 1. There are 2 subtraction operators on line 3.
1) var RobertsGPA = (1stPeriod + 2ndPeriod + 3rdPeriod + 4thPeriod + 5thPeriod + 6thPeriod)/6
2) var 1stPeriod = 3;
3) var 2ndPeriod = 2;
4) var 3rdPeriod = 5;
5) var 4thPeriod = 1;
6) var 5thPeriod = 4;
7) var 6thPeriod = 4;
8) console.log(RobertsGPA);
What does the console print?
a) 3.16 repeating 6
b) 3.16 terminating
c) 3.14 repeating
d) pi