After the if statement that follows is executed, what will the value of discount
ID: 3823382 • Letter: A
Question
After the if statement that follows is executed, what will the value of discountAmount be?
var discountAmount;
var orderTotal = 200;
if (orderTotal > 200) {
discountAmount = orderTotal * .3;
} else if (orderTotal > 100) {
discountAmount = orderTotal * .2;
} else {
discountAmount = orderTotal * .1;
}
Question 24 options:
0.0
20.0
40.0
60.0
Which of the following statements is false? A JavaScript variable
Question 22 options:
is case-sensitive
can start with a $ sign
can start with a number
can contain an underscore
When we talk about an object's property, we are describing...
Question 21 options:
Characteristics of objects
Things that happen to objects
The number of items in an object
The general composition of an object
Which object represents a web page?
Question 20 options:
page object
document object
window object
site object
In the following statement, the function show() is executed first.
$(".children").append("<p>Smart!</p>").show()
Question 9 options:
False
Javascript arrays must contain items of the same type (ex: all numbers or all strings).
Question 10 options:
False
The "this" keyword can be used without jQuery.
Question 11 options:
False
You can only use variables that start with a $ if you are using jQuery.
Question 12 options:
False
The load method always requests and returns JSON data.
Question 13 options:
False
One benefit of using Ajax to get data for a web page is that the page doesn’t have to be reloaded into the browser.
Question 14 options:
False
The JSONP for a web site tells you how you can use Ajax to get data from the site.
Question 15 options:
False
Which of these is a valid way of including a javascript file named "myScript.js" on a web page?
Question 16 options:
<script file="myScript.js"></script>
<javascript file="myScript.js" />
<script src="myScript.js"></script>
d) <javascript rel="myScript.js"></javascript
Which of these javascript comment blocks is correct?
Question 19 options:
// This is a comment
<!-- This is a comment -->
/* This is a comment */
A and C
All of the above
a)0.0
b)20.0
c)40.0
d)60.0
Explanation / Answer
After the if statement that follows is executed, what will the value of discountAmount be?
(C) 40.0
Which of the following statements is false? A JavaScript variable
(C) can start with a number
When we talk about an object's property, we are describing...
(D) The general composition of an object
Which object represents a web page?
(B) document object
n the following statement, the function show() is executed first. : $(".children").append("<p>Smart!</p>").show()
False
Javascript arrays must contain items of the same type (ex: all numbers or all strings).
True
The "this" keyword can be used without jQuery.
False
You can only use variables that start with a $ if you are using jQuery.
true
The load method always requests and returns JSON data.
False
One benefit of using Ajax to get data for a web page is that the page doesn’t have to be reloaded into the browser.
True
The JSONP for a web site tells you how you can use Ajax to get data from the site.
True
Which of these is a valid way of including a javascript file named "myScript.js" on a web page?
(C) <script src="myScript.js"></script>
Which of these javascript comment blocks is correct?
(D) A and C