Q1. You are developing a JavaScript library.
You have the following requirements:
Custom exceptions must include an error message and custom error number. These exceptions must be thrown when data validation errors occur. Developers must call the library to easily catch the exception and identify the problem.
You develop the following code. (Line numbers are included for reference only.)
You need to complete the code to meet the requirements.
Which line of code should you insert at line 09?
A. throw new Validatior.Exception (123, "Day of week must be les3 than 7");
B. return new ValidationException(123, "Day of week must be less than 7");
C. throw ValidationException(123, "Day of week must be less than 7");
D. catch ValidationException(123, "Day of week: must be less than 7");
Answer: A
Q2. You develop an HTML5 webpage with custom CSS. You have the following HTML markup:
<div class="new" Item">...</div>
You have the following requirements:
. In addition to your CSS, you must use a corporate branded stylesheet named corporate.ess.
. The corporate.ess file contains the style rule that must be used for .newsItem.
. You must use the corporate.ess file to ensure that the webpage changes when the brand changes.
. You must add additional style rules to the webpage.
. You cannot modify the corporate.ess file.
You need to apply the appropriate CSS rules to meet the requirements.
What should you do?
A. Add a CSS class named .newsItemUpdates to the webpage, add only the new styles to this class, and update the class attribute of the HTML markup:
<div class=nnewsltem newsItemUpdates">..,</div>
B. Update the corporate.ess file to include! important for each rule for the .newsItem. class, and add the new CSS rules to the webpage by using the CSS class .newsItem.
C. Add a CSS class named .newsitemUpdates to the webpage, add the new styles to this class, and update the HTML markup to replace the .newsItem class with this new class:
<div class*"newsItemOpdates">...</div>
D. Add the new CSS rules to the webpage by using the CSS class .newsItem, and add! important to each rule.
Answer: D
Q3. You are developing a web form that includes the following code.
When a user selects the check box, an input text box must be added to the page dynamically.
You need to ensure that the text box is added.
Which function should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
Q4. You are developing a web page by using HTML5.
You have the following requirements:
. An H1 element must be placed at the top left corner of the page.
. The size and location of the H1 element must not change if additional elements are added to the page.
You need to position the H1 element on the page.
Which CS53 style should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A A. readAsBinaryString() B. readAsArrayBuffer() C. readAsDataURL() D. readAsText() Answer: B
Q7. You are troubleshooting an application. Users report that the UI is slow to respond.
You need to improve UI responsiveness by moving application tasks to web workers.
Which two tasks can you move to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. A function that loops through the Document Object Model to update the style of page elements
B. A long-running calculation that requires looping through an array
C. A function that performs graphic-intensive animation
D. A function that stores large amounts of data to local storage
Answer: BC
Q8. You are creating a JavaScript object that represents a customer.
You need to extend the Customer object by adding the GetCommission() method.
You need to ensure that all future instances of the Customer object implement the GetCommission() method.
Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: D
Q9. You are developing an HTML5 page named main.html. The JavaScript code for the main page is located in a file named myApp.js.
You need to create a web worker and instantiate it from main.html.
Where should you place the web worker code?
A. In the myApp.js file
B. In the main.html file
C. In a separate .js (JavaScript) file
D. In a separate executable file
Answer: C
Q10. You are modifying an existing web page. The page is being optimized for accessibility. The current page contains the following HTML.
Standards-compliant screen readers must be able to identify the links contained within the navigation structure automatically.
You need to create the navigation link structure in the page.
With which container tags should you wrap the existing markup?
A. <navmap> </navmap>
B. <div id="nav"> </div>
C. <nav> </nav>
D. <map> </map>
Answer: C