This is NOT a good variable name.
a) favoriteColor
b) favorite Color
c) favColor
b) favorite Color
2 would be considered what data type.
Number
what will the console log?
dogType='chihuahua'
if(dogType=='chihuahua'){
console.log('You have a small dog')}
else{console.log('bowwow')}
You have a small dog
what will the console log
for(i=0;i<7;i++){
console.log(i)}
0 1 2 3 4 5 6
why would this show an error
favColor=='blue';
console.log(favColor)
two equal signs
This functions allows the user to input information.
a) console.log()
b) print()
c) prompt()
c) prompt()
'words' would be considered what data type
String
what will the console log
number = 2;
if((number-3)==0){
console.log('your number is the magic number')}
else if ((number-2)==0){
console.log('your number is almost the magic number')}
else{console.log('not even close')}
your number is almost the magic number
what will the console log
for(i=100;i<10;i++){
console.log(i)}
nothing (the initial i is too large so the loop breaks immediately)
why would this show an error
favColor = blue;
console.log(favColor)
blue is not a string
Given this code:
age=24;
age+=6;
console.log(age);
The console would say what.
30
A boolean data type can only be one of two options. The two options are this.
true or false
what will the console log
number = 2;
if((number-3)<=0){
console.log('your number is a magic number')}
if((number-2)==0){
console.log('your number is almost the magic number')}
else{console.log('not even close')}
your number is almost the magic number
what will the console log
for(i=0;i<20;i++){
if(i%3==1){
console.log(i)}
}
1 4 7 13 16 19
why would this show an error
count=0;
for (i=0;i<10;i++){
count+=i
}
consolelog(count)
consolelog is missing . (console.log)
Given this code:
number1=3;
number2=5;
console.log(number1*number2);
The console would say what.
15
favColor = prompt("What's your favorite color?")
What datatype will favColor be after running and answering the question?;
string (any answer to prompt will be catagorized as a string, even if you answered '2')
What will the console log
number = 125;
if (number%5 == 0){
console.log('your number is a multiple of 5')}
if (number%2==0){
console.log('your number is even')}
if (number%3 == 0){
console.log('your number is divisible by 3')}
your number is a multiple of 5
what will the console log
count = 0;
for(i=0;i<10;i++){
if (i%3==0){
count *= i;
}
}
162
why would this show an error
if(favColor = 'blue'){
console.log('that's my fav color too')
}
=
Given this code:
number1 = 7;
number2 = 8;
console.log("number1*number2");
The console would say what.
number1*number2
156%20
16
if(num%3==0){
num = num/3;
num=num%4;
console.log(num)}
else {
num=num*2;
num=num%5;
console.log(num)}
what will the console log is num=31;
1
what will the console log
count = 0;
for(i=0;i<10;i++){
if (i%3==0){
count *= i;
}
else{
count+=i;
}}
1107