Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Question 1
- 0 out of 1.85 points
- A jQuery selector begins with a $ sign that refers to the jQuery ________________________.
- Question 2
- 1.85 out of 1.85 points
- When a JavaScript object is serialized,
- Question 3
- 1.85 out of 1.85 points
- The following code displays
- var text = "A111-B222-C333";
- if (/^\d{4}-\d{4}-\d{4}-\d{4}$/.test(text)) {
- alert("Valid1");
- } else if (/^\d{4}-\d{4}-\d{4}$/.test(text)) {
- alert("Valid2");
- } else {
- alert("NOT Valid");
- }
- Question 4
- 0 out of 1.85 points
- In most cases, the best way to find a jQuery plugin that performs a specific task is to
- Question 5
- 0 out of 1.85 points
- Binary is a format that uses 1’s and 0’s to represent data, while CSV, XML, and JSON are ______________________ formats that use letters and symbols to represent data.
- Question 6
- 1.85 out of 1.85 points
- To load a web page into a web browser, you can
- Question 7
- 0 out of 1.85 points
- Sometimes, validating the HTML code for a web page will help you debug an application, because
- Question 8
- 1.85 out of 1.85 points
- One of the benefits of using JSON is that it’s easy to work with when you’re using ______________________.
- Question 9
- 1.85 out of 1.85 points
- Which of the following statements about an array of arrays is true?
- Question 10
- 1.85 out of 1.85 points
- Which of the following is used in a regular expression pattern to match the beginning of a string?
- Question 11
- 1.85 out of 1.85 points
- The six data types allowed in JSON are strings, numbers, Booleans, arrays, objects, and
- Question 12
- 1.85 out of 1.85 points
- The following code
- var display_error = function(message) {
- alert("Error: " + message);
- }
- Question 13
- 1.85 out of 1.85 points
- Code example 10-1
- var add = function( x, y ) {
- return ( x + y );
- }
- alert( add (5, 3) );
- (Refer to code example 10-1.) The function
- Question 14
- 0 out of 1.85 points
- The ________________ are the jQuery UI components that you’re most likely to use.
- Question 15
- 1.85 out of 1.85 points
- What text does the following code display in a dialog box?
- alert("The file is in \"C:\\My Documents\"");
- Question 16
- 0 out of 1.85 points
- What method of the String object searches the string for an occurence of the specified search string?
- Question 17
- 0 out of 1.85 points
- The jQuery plugins require the use of the ________________ library.
- Question 18
- 1.85 out of 1.85 points
- JavaScript code runs on the
- Question 19
- 1.85 out of 1.85 points
- Code example 17-2
- A plugin that highlights menu items
- (function($){
- $.fn.highlightMenu = function(options) {
- var o = $.extend({
- "mouseoverClass" : "mouseover",
- "mouseoutClass" : "mouseout",
- "useMouseout" : true
- }, options);
- return this.each(function() {
- var items = $(this).find("a");
- items.mouseover(function() {
- $(this).addClass(o.mouseoverClass);
- if (o.useMouseout) {
- $(this).removeClass(o.mouseoutClass);
- }
- });
- items.mouseout(function() {
- $(this).removeClass(o.mouseoverClass);
- if (o.useMouseout) {
- $(this).addClass(o.mouseoutClass);
- }
- });
- });
- };
- })(jQuery);
- (Refer to code example 17-2) If this plugin is used with a menu that contains 10 items, how many elements is the plugin function applied to?
- Question 20
- 0 out of 1.85 points
- When you test an application with Chrome’s developer tools and a breakpoint is reached, you can click
- Question 21
- 1.85 out of 1.85 points
- Which of these for statements displays even numbers from 0 to 10?
- Question 22
- 1.85 out of 1.85 points
- Which of the following jQuery methods can you use to set the text of an element?
- Question 23
- 1.85 out of 1.85 points
- A function for the ready event method will run any methods that it contains as soon as the _______________________ is ready.
- Question 24
- 1.85 out of 1.85 points
- What is the value of random after the following code executes?
- var random = Math.floor(Math.random() * 10);
- random = random + 1;
- Question 25
- 1.85 out of 1.85 points
- The ______________________ method of the JSON object converts a JavaScript object to a JSON string.
- Question 26
- 1.85 out of 1.85 points
- What property of the Radio object is used to determine if a radio button is selected?
- Question 27
- 0 out of 1.85 points
- If a JavaScript object has a toJSON method, and a replacer function is passed to the stringify method,
- Question 28
- 1.85 out of 1.85 points
- What is the value of selected when the following code executes?
- var num = "three";
- var selected = num && parseFloat(num) || num || "";
- Question 29
- 1.85 out of 1.85 points
- Given the following lines of code, what will be displayed in successive dialog boxes?
- var answers = [ "C", "B", "D", "A" ];
- delete answers[3];
- for ( var i = 0; i < answers.length; i++ ) {
- alert(answers[i]);
- }
- Question 30
- 1.85 out of 1.85 points
- To use a jQuery UI widget, you must code both the ________________ and the jQuery code in the way that’s prescribed for the widget.
- Question 31
- 1.85 out of 1.85 points
- 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 32
- 1.85 out of 1.85 points
- What method of the Math object can be used to return the largest value from the values that are passed to it?
- Question 33
- 1.85 out of 1.85 points
- Which of the following is a benefit of using the JSON data format?
- Question 34
- 1.85 out of 1.85 points
- Code example 11-3
- var Employee = function(firstName, lastName) {
- this.firstName = firstName;
- this.lastName = lastName;
- };
- Employee.prototype.getFullName = function() {
- return this.firstName + " " + this.lastName;
- };
- (Refer to code example 11-3.) The following code displays
- var employee = new Employee("Grace", "Hopper");
- employee.lastName = "Murach";
- alert (employee.getFullName());
- Question 35
- 1.85 out of 1.85 points
- What is the value of the message variable after the following code executes?
- var message = "";
- for (var i = 0; i < 5; i++ ) {
- message += "L:" + i + ",";
- }
- Question 36
- 1.85 out of 1.85 points
- When you develop a web page, you should use HTML to provide
- Question 37
- 1.85 out of 1.85 points
- After the statements that follow are executed,
- var firstName = "Ray", lastName = "Harris";
- var fullName = lastName;
- fullName += ", ";
- fullName += firstName;
- Question 38
- 0 out of 1.85 points
- The code that follows has a bug in it because the second use of the variable named salesTax is spelled with all lowercase letters (salestax).
- var calculateTax = function(subtotal,taxRate) {
- var salesTax = subtotal * taxRate;
- salestax = parseFloat(salesTax.toFixed(2));
- return salesTax;
- }
- Assuming that there are no other problems and that you’re using strict mode, what will happen when this code is executed?
- Question 39
- 1.85 out of 1.85 points
- Which of the following is a valid statement for declaring and initializing a variable named length to a starting value of 120?
- Question 40
- 0 out of 1.85 points
- What does the second statement that follows do?
- var numbers = [1, 2, 3, 4];
- numbers.length = 0;
- Question 41
- 1.85 out of 1.85 points
- What does the following jQuery code do?
- $("#image").attr("src", imageURL);
- Question 42
- 1.85 out of 1.85 points
- All JSON data types are represented as key/value pairs, with the key name in
- Question 43
- 1.85 out of 1.85 points
- Code example 4-1
- var add = function( x, y ) {
- return ( x + y );
- }
- alert( add (5, 3) );
- (Refer to code example 4-1) The alert method in this example
- Question 44
- 1.85 out of 1.85 points
- If a numerical operation returns a number greater than the largest possible JavaScript value, it returns
- Question 45
- 1.85 out of 1.85 points
- Code example 16-2
- var employee = {
- name: "G. Hopper",
- start: new Date("1/1/2000"),
- salary: 90000
- };
- var regions = ["northwest", "southwest", "central", "east"];
- var replacer = function (key, value) {
- if (key === "") { return value; }
- if (key === "salary") { return undefined; }
- if (typeof value === "string") {
- var first = value.substring(0,1).toUpperCase();
- var remaining = value.substring(1);
- return first + remaining;
- } else { return value; }
- };
- (Refer to code example 16-2) What JSON string does the following code produce?
- JSON.stringify(employee, replacer);
- Question 46
- 1.85 out of 1.85 points
- To call a jQuery method, you code a _____________________ that represents one or more elements, the dot operator, and the method name.
- Question 47
- 1.85 out of 1.85 points
- Given a Date object named due_date, which of the following statements sets the month to February?
- Question 48
- 0 out of 1.85 points
- What does the code that follows do?
- $("email").firstChild.nodeValue = "Entry is invalid.";
- Question 49
- 1.85 out of 1.85 points
- Which method returns the elements of an array in a string separated by a comma?
- Question 50
- 0 out of 1.85 points
- Which of the following is NOT one of the three testing phases of a JavaScript application?
- Question 51
- 1.85 out of 1.85 points
- Which method of a regular expression searches a string and returns true if the pattern is found?
- Question 52
- 1.85 out of 1.85 points
- What happens when an exception is thrown inside a try block?
- Question 53
- 0 out of 1.85 points
- Which property of an Error object stores the type of error?
- Question 54
- 1.85 out of 1.85 points
- Code example 16-1
- var json = "[{\"task\":\"Do taxes\",\"due\":\"2016-04-15T07:00:00.000Z\"}";
- json = json + ",{\"task\":\"Do Laundry\"}]";
- var tasks = JSON.parse(json);
- (Refer to code example 16-1) What JavaScript does this code produce?
- Question 55
- 1.85 out of 1.85 points
- What is displayed when the following code executes?
- var age = 19, score = 750;
- if ( age >= 21 && score >= 700 ) {
- alert ("Loan approved");
- } else if ( age >= 21 && score >= 650 ) {
- alert ("Cosigner needed.");
- } else if ( age >= 18 && score >= 680 ) {
- alert ("Two cosigners needed.");
- } else {
- alert ("Loan denied.");
- }
- Question 56
- 1.85 out of 1.85 points
- Which of the strings matches the following pattern?
- /^[01]?\d\/[0-3]\d\/\d{4}$/
- Question 57
- 1.85 out of 1.85 points
- Which of the following causes the parse method to throw an exception?
- Question 58
- 0 out of 1.85 points
- The jQuery functions will work in all browsers because they are coded and tested for _________________________ compatibility.
- Question 59
- 1.85 out of 1.85 points
- After the statement that follows is executed, rateText represents
- var rateText = document.getElementById("rate");
- Question 60
- 1.85 out of 1.85 points
- All parameters passed to a function are available in what property of the function?
- Question 61
- 1.85 out of 1.85 points
- What does the match method of a String object return if the global flag is set and a match is found?
- Question 62
- 1.85 out of 1.85 points
- If you download the jQuery core library, you can include it in a web page by coding a ____________________ element.
- Question 63
- 0 out of 1.85 points
- If you’re using the Chrome browser and a JavaScript application stops running due to an error in the JavaScript code, you can identify the statement that caused the error by
- Question 64
- 1.85 out of 1.85 points
- What does the following jQuery code do?
- $("h2").prev();
- Question 65
- 1.85 out of 1.85 points
- Code example 10-1
- var add = function( x, y ) {
- return ( x + y );
- }
- alert( add (5, 3) );
- (Refer to code example 10-1.) This code
- Question 66
- 1.85 out of 1.85 points
- When a function’s this keyword is undefined, how was the function invoked?
- Question 67
- 1.85 out of 1.85 points
- How can you clear a check from a Checkbox object?
- Question 68
- 1.85 out of 1.85 points
- What can you use to clarify the order of relational and logical operations in a conditional expression?
- Question 69
- 1.85 out of 1.85 points
- When a data structure is ______________________, it’s converted to a format that can be transmitted and stored.
- Question 70
- 1.85 out of 1.85 points
- A coding error that produces the wrong results when the application is run is known as a
- Question 71
- 1.85 out of 1.85 points
- For the following code, an event handler named investment_change is
- var investment_change = function() {
- var years = parseInt( $("years").value );
- alert("Years: " + years);
- }
- window.onload = function() {
- $("investment").onchange = investment_change;
- }
- Question 72
- 1.85 out of 1.85 points
- Three of the common CSS selectors select
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement