JavaScript Basics

What's the standard extension for JavaScript files?
.javascript
.js
.html
.css
Other
Please Specify:
Which is not a standard JavaScript type?
Number
Integer
String
Boolean
Other
Please Specify:
What is a variable?
A "box" that stores information
A "box" that stores an unchangeable value
A JavaScript statement
A JavaScript number
Other
Please Specify:
If a user enters "10" when prompted, what will the result be?
 
var x = Number (prompt("Enter a value:"));
var result = x * 3 - 1;
result += 5;
console.log(result);
 
 
24
34
4
Undefined
Other
Please Specify:
If a variable's role is to store the total amount of an invoice, what should we name it (in compliance with camelCase)?
Invoice_total
InvoiceTotal
InvoiceTotal
Invoicetotal
Other
Please Specify:
If a user enters 10, what will the result be?
 
var x = Number (prompt("Enter a value:"));
if (x <= 10) {
if (x >= 5) {
console.log ( "A");
}
console.log("B");
} else {
console.log("C");
}
 
 
"A"
"B"
"C"
"A" and "B"
Other
Please Specify:

Which operator should be used in the place of "???" so that the statements make sense?

var num1 = Number (prompt("Enter the number 1:"));
var num2 = Number (prompt("Enter the number 2:"));
 
if ((num1 < 0) ??? (num2 < 0)) {
console.log("At least one of the two numbers is negative");
} else {
console.log("The two numbers are positive or zero");
}

   

 
AND operator: &&
OR operator: ||
NOT operator: !
No operator
Other
Please Specify:

How many times will the text display in this program?

var i = 0;
while (i <= 4) {
console.log ( "Hey there!");
i++;
}

 

 
4 times
5 times
3 times
Infinite times
Other
Please Specify:

How many times will the text display in this program?

for(var i = 1; i < 5; i ++) {
console.log ( "What's up?");
}

 

 
4 times
5 times
6 times
Infinite times
Other
Please Specify:
When you don't know how many times a loop should run, which loop type should you choose?
While loop
For loop
While or For, either one
Other
Please Specify:
{"name":"JavaScript Basics", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"What's the standard extension for JavaScript files?, Which is not a standard JavaScript type?, What is a variable?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker