Fill in the Blank
Methods
Let...
Define the code
Wild
100

The JavaScript______method is typically applied to an individual field in a web form to indicate that an invalid value has been entered.

 reset()

100

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()

100

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

100

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

100

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

200

The regular expression /\b\$\d+/g will match words beginning with a ______ sign and one or more digits, such as "$5" or "$500".

dollar

200

Which method inherited by all objects in JavaScript can be used to return a text string representation of an object?

toString()

200

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 ");

200

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.

200

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.

300

A JavaScript closure is created when _____.

document.forms.customOrder.elements.color[0]

300

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)

300

What does the following JavaScript statement do?

 let timeID = window.setTimeout(logOut, 60000);

runs the logOut function after a 1-minute delay

300

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

300

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

400

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();

400

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

400

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.

400

What does the following JavaScript statement do?

 let timeID = window.setTimeout(logOut, 60000);

runs the logOut function after a 1-minute delay

400

What was the last concert I went to?

Olivia Rodrigo

500

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

500

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...";

}

500

In JavaScript, the following statement _____.

let town = {

   name: "Helena",

   county: "Shelby",

   population: 18500

};

creates an associative array containing three key-value pairs

500

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

500

What my favorite season?

Spring