If chooseActivity is a JavaScript promise object that returns a string value, which code should you use to initiate this promise?
Blog
A common strategy among JavaScript developers whose web apps…
A common strategy among JavaScript developers whose web apps employ cookies is to write a function that assembles the text string for a cookie from a list of values that is passed in, then stores that text string as a document cookie.
Suppose you want to add the following statement to your Java…
Suppose you want to add the following statement to your JavaScript code in order to help you trace an error. What belongs in the blank?_____(“totalPrice = ” + totalPrice);
Using the statement document.cookie = “cakeFlavor=carrot;dom…
Using the statement document.cookie = “cakeFlavor=carrot;domain=weather.com”; to define a cookie makes it available to all domains on the weather.com website, whether or not they are found on your web server.
What belongs in the blank if you are writing a JavaScript wh…
What belongs in the blank if you are writing a JavaScript while loop that will display the numbers 1 to 10 in descending order?let i = 10;_____ document.write(i + “”); i–;}document.write(“Countdown: ” + i + “”);
After executing the following JavaScript code, the value of…
After executing the following JavaScript code, the value of the variable pieFlavors will be _____.let pieFlavors = [“pecan”, “apple”, “lemon”, “key lime”];pieFlavors.reverse();pieFlavors.sort();
To use the proxy server approach to handle requests to third…
To use the proxy server approach to handle requests to third-party APIs, you must set up your own proxy server, then use an AJAX request object or Fetch to make the request of the proxy server.
Suppose you want to write a command block that counts by thr…
Suppose you want to write a command block that counts by threes from 3 to 99 and displays the results. What should you place in the blank?_____ document.write(i + “”);}
Suppose you have just written a JavaScript constructor for a…
Suppose you have just written a JavaScript constructor for a button class with the parameters buttonColor, buttonDiameterInches, and buttonHoles. Which statement can you use to create an instance of button to represent a blue, 0.25-inch button with four holes named button1?
You are examining a JavaScript program and find a series of…
You are examining a JavaScript program and find a series of nested if statements, each of which includes a test condition that verifies that a request object had a completed response and a successful connection, followed by the instantiation of a new request object. Once the inner if condition is verified, the program calls the open() and send() methods on each successful request object in turn. This situation _____.