The JavaScript______method is typically applied to an individual field in a web form to indicate that an invalid value has been entered.
reset()
Which JavaScript method should you use to ask the user, “Is it okay to schedule the selected appointment?” and obtain a Boolean value of true for “Okay” or false for “Cancel”?
window.confirm()
What will the value of the variable x be after the following JavaScript statements execute?
let sampleRhyme = "Hickory, dickory, dock. The mouse ran up the clock.";
let regx = /[^a-zA-Z]/;
let x = sampleRhyme.search(regx);
7
In the following JavaScript statement, "Wizard", "Staff of wisdom", and 115 are called what?
let character = {
class: "Wizard",
weapon: "Staff of wisdom",
healthLevel: 115
};
keys
When creating a website for international audiences, you should make your web page layouts flexible because _____.
text translations may contain more or fewer words than the original, and some languages are read from right to left
The regular expression /\b\$\d+/g will match words beginning with a ______ sign and one or more digits, such as "$5" or "$500".
dollar
Which method inherited by all objects in JavaScript can be used to return a text string representation of an object?
toString()
Which JavaScript statement should you use to determine whether the string stored in the variable funnyStory includes the word “cat”?
let includesCat = funnyStory.includes(" cat ");
What will the following statement do?
window.open("http://www.example.com", "New Window", toolbar=0, menubar=0");
Open a new browser window that includes the browser menu bar and toolbar.
How are node properties related to inline styles?
You can define individual styles in JavaScript by appending the style property and a style value to an object.
A JavaScript closure is created when _____.
document.forms.customOrder.elements.color[0]
If the playTime variable in a JavaScript program has been initialized, the id of a timed command has been stored in it, and that timed command has been initiated, which method can be called to stop this timed command?
window.clearInterval(playTime)
What does the following JavaScript statement do?
let timeID = window.setTimeout(logOut, 60000);
runs the logOut function after a 1-minute delay
What does the following JavaScript code do?
let titles = "Mr.|Mrs.|Miss|Ms.|Dr.";
let spotTitle = new RegExp(titles, "g");
defines a regular expression with a global flag by creating an object constructor
If the playTime variable in a JavaScript program has been initialized, the id of a timed command has been stored in it, and that timed command has been initiated, which method can be called to stop this timed command?
window.clearInterval(playTime
To format a number stored in the variable x using the local standards for displaying numeric values on a user’s computer, you can use the JavaScript statement _____.
x.toLocaleString();
What type of method is sizeCategory() in the following JavaScript code?
function stones(stoneCount) {
this.count = stoneCount;
function sizeCategory() {
if (stoneCount > 10) return "Big";
else return "Small";
}
this.showCategory = function() {
console.log("Category: " sizeCategory()};
}
}
private
The following JavaScript statements will do what?
let snacks = ["almond", "pecan", "walnut", "pistachio", "peanut"];
for (let prop in snacks) {
console.log(prop + " is " + snacks[prop]);
}
successfully log the values contained in the snacks array to the console.
What does the following JavaScript statement do?
let timeID = window.setTimeout(logOut, 60000);
runs the logOut function after a 1-minute delay
What was the last concert I went to?
Olivia Rodrigo
When creating a website for international audiences, you should make your web page layouts flexible because _____.
text translations may contain more or fewer words than the original, and some languages are read from right to left
Suppose you have written code to create a JavaScript class called bear. What command should you use to add a method called hibernate to the template for the bear class (not to its constructor)?
bear.prototype.hibernate = function() {
return "Zzzzzzz...";
}
In JavaScript, the following statement _____.
let town = {
name: "Helena",
county: "Shelby",
population: 18500
};
creates an associative array containing three key-value pairs
You see the following line within the HTML file for a web page you are working on:
<input id="sourceText" type="file" />
This means that _____.
the user of the page can select a file that you will be able to access using a JavaScript File Reader API
What my favorite season?
Spring