option
Cuestiones
ayuda
daypo
buscar.php

acjs4

COMENTARIOS ESTADÍSTICAS RÉCORDS
REALIZAR TEST
Título del Test:
acjs4

Descripción:
test numero 4

Fecha de Creación: 2025/06/27

Categoría: Otros

Número Preguntas: 63

Valoración:(0)
COMPARTE EL TEST
Nuevo ComentarioNuevo Comentario
Comentarios
NO HAY REGISTROS
Temario:

1 - Refer to he code below: const pi = 3.1415926; What is the data type of pi?. Float. Decimal. Number. Double.

2 - A developer wants to use a try...catch statement to catch any error that count Sheep () may throw and pass it to a handleError() function. What is the correct implementation of the try...catch?. try { setTimeout(function() { count Sheep(); }, 1000); } catch (e) { handleError (e); }. try { count Sheep(); }handleError (e) { catch (e); }. c. d.

3. Rejected. Rejected Resolved4. Resolved1 Resolved2 Resolved3 Resolved4. Resolved1 Resolved2 Rejected Resolved4.

4 - Given the code block below: 01 function Game Console (name) { 02 this.name = name; 03 } 04 05 GameConsole.prototype.load = function (gamename) { 06 console.log("$(this.name) is loading a game: $(gamename)..."); 07 } 08 09 function Console16bit (name) 10 GameConsole.call(this, name); 11 } 12 13 Console16bit.prototype = object.create (GameConsole.prototype); 14 15 // insert code here 16 console.log("$(this.name) is loading a cartridge game: $(gamename)..."); 17 } 18 const console16bit = new Console16Bit('SNEGeneziz'); 19 console16bit .load('Super Monic 3x Force'); What should a developer insert at line 15 to output the following message using the load method? > SNEGeneziz is loading a cartridge game: Super Monic 3x Force... Console16bit.prototype.load(gamename) (. Console16bit.prototype.load(gamename) function() {. Console16bit = object.create (GameConsole.prototype).load function (ganename) {. Console16bit.prototype.load = function (gamename) {.

5 - A team at Universal Containers works on a big project and use yarn to deal with the project's dependencies. A developer added a dependency to manipulate dates and pushed the updates to the remote repository. The rest of the team complains that the dependency does not get downloaded when they execute yarn. What could be the reason for this?. The developer added the dependency as a dev dependency, and YARN_ENV is set to production. The developer added the dependency as a dev dependency, and NODE_ENV is set to production. The developer missed the option add when adding the dependency. The developer missed the option --save when adding the dependency.

6 - A class was written to represent items for purchase in an online store, and a second class representing items that are on sale at a discounted price. The constructor sets the name to the first value passed in. The pseudocode is below: class Item { constructor (name, price) { ... // Constructor Implementation } } class SaleItem extends Item { constructor (name, price, discount) { // Constructor Implementation } }. This is a Scarf This is a Shirt This is a discounted Scarf This is a discounted Shirt. This is a Scarf This is a Shirt This is a Scarf This is a discounted Shirt. This is a Scarf Uncaught TypeError: saleItem.description is not a function This is a Shirt. d.

7 - A developer needs to debug a Node.js web server because a runtime error keeps occurring at one of the endpoints. The developer wants to test the endpoint on a local machine and make the request against a local server to look at the behavior. In the source code, the server.js file will start the server. The developer wants to debug the Node.js server only using the terminal. Which command can the developer use to open the CLI debugger in their current terminal window?. node server.js --inspect. node inspect server.js. node -i server.js. node start inspect server.js.

8 - Refer to the following code: 01 function Tiger () ( 02 this.type 'Cat'; 03 this.size = 'large'; 04 } 05 06 let tony = new Tiger(); 07 tony.roar = () => { 08 console.log('They\'re great!'); 09 ); 10 11 function Lion () { 12 this.type 'Cat'; 13 this.size 'large'; 14 } 15 16 let leo new Lion(); 17 // Insert code here 18 leo.roar(); Which two statements could be inserted at line 17 to enable the function call on line 18? Choose 2 answers. leo.prototype.roar () { console.log('They're pretty good!"); };. Object.assign(leo, Tiger);. leo.roar () => { console.log('They're pretty good!'); };. Object.assign(leo, tony);.

9 - Refer to the code below: let inArray = [[1,2], [3,4,5] ]; Which two statements result in the array [1, 2, 3, 4, 5 ]? Choose 2 answers. [].concat(...inArray);. [].concat.apply(inArray, []);. [].concat([...inArray]);. [].concat.apply([], inArray);.

10 - A developer removes the HTML class attribute from the checkout button, so now it is simply: <button>Checkout</button> There is a test to verify the existence of the checkout button, however it looks for a button with class="blue". The test fails because no such button is found. Which type of test category describes this test?. True positive. False positive. False negative. True negative.

11. 10. 11. 12. 13.

12 - What are two unique features of functions defined with a fat arrow as compared to normal function definition? Choose 2 answers. The function receives an argument that is always in scope, called parent This, which is the enclosing lexical scope. The function uses the this from the enclosing scope. The function generates its own this making it useful for separating the function's scope from its enclosing scope. If the function has a single expression in the function body, the expression will be evaluated and implicitly returned.

13 - A developer wants to leverage a module to print a price in pretty format, and has imported a method as shown below: import print Price from '/path/PricePrettyPrint.js'; Based on the code, what must be true about the print Price function of the Price PrettyPrint module for this import to work?. printPrice must be the default export. printPrice must be a named export. print Price must be a multi export. printPrice must be an all export.

14 - Refer to the code bellow: 2 2 undefined undefined. 2 2 1 1. 2 2 1 2. 2 2 2 2.

15. [1,2,3,5]. [1,2,3,4,5,4,4]. [1,2,3,4,4,5,4]. [1,2,3,4,5,4].

16. A variable displaying the number of instances created for the Car object. The style, event listeners and other attributes applied to the carSpeed DOM element. The information stored in the window.localStorage property. The values of the carSpeed and fourWheels variables.

17. [1,2,3,4,5,4,4]. [1,2,3,5]. [1,2,3,4,5,4]. [1,2,3,4,4,5,4].

18. console.error (number % 2 === 0);. console.debug(number % 2 === 0);. console.assert(number % 2 === 0);. assert (number % 2 === 0);.

19 - A developer wants to create an object from a function in the browser using the code below. 01 function Monster () { this.name = 'hello' }; 02 const m = Monster(); What happens due to the lack of the new keyword on line 02?. window.name is assigned to 'hello' and the variable m remains undefined. The variable is assigned the correct object but this.name remains undefined. window.m is assigned the correct object. The variable is assigned the correct object.

20 - Which three actions can be done using the JavaScript browser console? Choose 3 answers. View and change security cookies. View and change the DOM of the page. Display a report showing the performance of a page. Run code that is not related to the page. View, change, and debug the JavaScript code of the page.

21. End Start Success. Start End Success. Start Success End. Success Start End.

22. Car 3 completed the race. Car 1 crashed in the race. Race is cancelled. Car 2 completed the race.

23 - Which option is true about the strict mode in imported modules?. Add the statement use strict false; before any other statements in the module to enable not-strict mode. Add the statement use non-strict; before any other statements in the module to enable not-strict mode. Imported modules are in strict mode whether you declare them as such or not. A developer can only reference notstrict() functions from the imported module.

24 - 24 of 63. Refer to the code below: 01 const event = new CustomEvent ( 02 //Missing code 03 ); 04 obj.dispatchEvent (event); A developer needs to dispatch a custom event called update to send information about recordId. Which two options could a developer insert at the placeholder in line 02 to achieve this? Choose 2 answers. (type 'update', recordId: '123abc'). 'update', '123abc". 'update', { detail: { recordId: '123abe' } }. 'update', { recordId: '123abe' }.

25. Change line 5 to function world()(. Change line 9 to sayHello (world)();. Change line 2 to console.log("Hello", name());. Change line 7 to }();.

26. NaN. 10. 5. undefined.

27. const addBy = function (num1){ return num1 + num2; }. const addBy = (num1) => (num2) => num1 + num2;. const addBy = (num1) => num1 + num2;. const addBy = function (num1){ return function (num2){ return num1 + num2; } }.

28 - A developer has an isDog function that takes one argument, pet. They want to schedule the function to run every minute. What is the correct syntax for scheduling this function?. setTimeout(isDog('cat'), 60000);. setInterval(isDog('cat'), 60000);. setInterval(isDog, 60000, 'cat');. setTimeout(isDog, 60000, 'cat');.

29. 01 let requestPromise = client.getRequest; 02 03 try ( 04 requestPromise().then((response) => { 05 handleResponse(response); 06 }).then((error) => { 07 throw new Error(error.name); 08 }). 09 } catch (error) { 10 handleError(error); 11 }. 01 let requestPromise = client.getRequest; 02 03 try ( 04 requestPromise().then((response) => { 05 handleResponse(response); 06 }); 07 } catch (error) { 08 handleError(error); 09 }. 01 let requestPromise = client.getRequest; 02 03 requestPromise().then((response) => { 05 handleResponse(response); 06 }).finnally(error) => { 07 handleError(error); 08 });. 01 let requestPromise = client.getRequest; 02 03 requestPromise().then((response) => { 04 handleResponse(response); 05 }).catch(error) => { 06 handleError(error); 07 });.

30. 11. 16. 25. 36.

31 - After user acceptance testing, the developer is asked to change the webpage background based on user's location. This change was implemented and deployed for testing. The tester reports that the background is not changing, however it works as required when viewing on the developer's computer. Which two actions will help determine accurate results? Choose 2 answers. The developer should inspect their browser refresh settings. The tester should disable their browser cache. The tester should clear their browser cache. The developer should rework the code.

32 - A developer wants to create a simple imagen upload in the brwser using the file API. below: (no se veia, invent). 04 const reader new FileReader(); 08 if (file) reader.readAsDataURL(file);. 04 const reader = new FileReader(); 08 if (file) URL.createObjectURL(file);. 04 const reader = new File(); 08 if (file) URL.createObjectURL(file);. 04 const reader = new File(); 08 if (file) reader.readAsDataURL(file);.

33. 'none' : 'block'. 'hidden' : 'visible'. 'block' : 'none'. 'visible' : 'hidden'.

34 - Refer to the string below: const str Salesforce'; Which two statements result in the word 'Sales'? Choose 2 answers. str.substr(0, 5);. str.substring(0, 5);. str.substr(1, 5);. str.substring(1, 5);.

35. {author: "Robert", title: "JavaScript" } { author: "Robert", title: "JavaScript" }. {author: "Robert", title: "Javascript"} undefined. {author: "Robert" } { author: "Robert", title: "JavaScript" }. { title: "JavaScript" } title: "JavaScript" }.

36. 'new york'. An error. undefined. 'New York'.

37 - Given the code below: const copy = JSON.stringify([new String('false'), new Boolean (false), undefined]); What is the value of copy?. '["false", false, undefined]'. '["false", false, null]'. '[false,{}]'. '["false",{}]'.

38 - Which statement parses successfully?. JSON.parse("foo");. JSON.parse(" 'foo' ");. JSON.parse(' "foo" ');. JSON.parse('foo');.

39 - Refer to the code below: 01 let sayHello() => { 02 console.log('Hello, World!'); 03 ); Which code executes sayHello once, two minutes from now?. setTimeout(sayHello, 120000);. setInterval(sayHello, 120000);. setTimeout(sayHello(), 120000);. delay (sayHello, 120000);.

40 - Refer to the code below: let productSKU = '8675309'; A developer has a requirement to generate SKU numbers that are always 19 characters long, starting with 'sku', and padded with zeros. Which statement assigns the value sku0000000008675309?. productSKU = productSKU.padEnd (16, '0').padStart (19, 'sku');. productSKU = productSKU.padEnd (16, '0').padStart ('sku');. productSKU = productSKU.padStart (16, '0').padStart ('sku');. productSKU = productSKU.padStart (16, '0').padStart (19, 'sku'");.

41 - A developer is leading the creation of a new browser application that will serve a single page application. The team wants to use a new web framework Minimalist.js. The lead developer wants to advocate for a more seasoned web framework/library that already has a community around it. Which two frameworks/libraries should the lead developer advocate for? Choose 2 answers. Koa. React. Vue. Express.

42 - Which statement accurately describes the behavior of the async/await keywords?. The associated class contains some asynchronous functions. The associated function sometimes returns a promise. The associated function can only be called via asynchronous methods. The associated function is asynchronous, but acts like synchronous code.

43 - A developer creates a simple webpage with an input field. When a user enters text in the input field and clicks the button, the actual value of the field must be displayed in the console. Here is the HTML file content: <input type="text" value="Hello" name="input"> <button type="button">Display</button>. Replace line 04 with console.log(input.value);. Replace line 02 with button.addEventListener("onclick", function() {. Replace line 03 with const input = document.getElementByName('input');. Replace line 02 with button.addCallback("click", function() {.

44 - A developer creates a new web server that uses Node.js. It imports a server library that uses events and callbacks for handling server functionality. The server library is imported with require and is made available to the code by a variable named server. The developer wants to log any issues that the server has while booting up. Given the code and the information the developer has, which code logs an error at boot time with an event?. 01 server.catch((error) => { 02 console.log("ERROR", error); 03 });. 01 server.error((error) => { 02 console.log("ERROR", error); 03 });. 01 server.on('error', (error) => { 02 console.log("ERROR", error); 03 });. 01 try { 02 server.start(); 03 }catch (error) {.

45. console.assert(sum3 ([1, '2']) == 12);. console.assert(sum3 (['hello', 2, 3, 4]) === NaN);. console.assert(sum3 ([-3, 2]) === -1);. console.assert(sum3 ([0]) === 0);.

46 - Which statement accurately describes an aspect of promises?. .then() manipulates and returns the original promise. Arguments for the callback function passed to .then() are optional. .then() cannot be added after a catch. In a .then() function, returning results is not necessary since callbacks will catch the result of a previous promise.

47 - A developer wants to set up a secure web server with Node.js. The developer creates a directory locally called app-server, and the first file is app-server/index.js. Without using any third-party libraries, what should the developer add to index.js to create the secure web server?. const tls = require('tls');. const http = require('http');. const https = require('https');. const server = require('secure-server');.

48. Use the browser console to execute a script that removes all the elements containing the class ad-library-item. Use the DOM Inspector to prevent the load event to be fired. Use the browser console to execute a script that prevents the load event to be fired. Use the DOM Inspector to remove all the elements containing the class ad-library-item.

49 - A developer tries to retrieve all cookies, then sets a certain key value pair in the cookie. These statements are used: 01 document.cookie; 02 document.cookie='key=John Smith'; What is the behavior?. Cookies are read and the key value is set, and all cookies are wiped. Cookies are read, but the key value is not set because the value is not URL encoded. Cookies are not read because line 01 should be document.cookies, but the key value is set and all cookies are wiped. Cookies are read and the key value is set, the remaining cookies are unaffected.

50. 'London'. NaN. Undefined. An error.

51. Add a handler to the personalizeWebsiteContent script to handle the load event. Add a listener to the window object to handle the DOMContentLoaded event. Add a listener to the window object to handle the load event. Add a handler to the personalizeWebsiteContent script to handle the DOMContentLoaded event.

52 - Refer to the HTML below: <p> The current status of an Order: <span id="status"> In Progress </span> </p> Which JavaScript statement changes the text 'In Progress' to 'completed'?. document.getElementById("status").Value 'Completed';. document.getElementById("status").innerHTML = 'Completed';. document.getElementById(".status").innerHTML= 'Completed';. document.getElementById("#status").innerHTML = 'Completed';.

53. On line 02, use event. first to test if it is the first execution. On line 04, use button.removeEventListener('click', listen);. On line 06. add an option called once to button.addEventListener();. On line 04, use event.stopPropagation();.

54 - A developer wants to use a module called DatePrettyPrint. This module exports one default function called printDate(). How can a developer import and use the printDate() function?. import printDate from /path/DatePrettyPrint.js'; DatePrettyPrint.printDate();. import printDate from /path/DatePrettyPrint.js'; printDate();. import DatePrettyPrint from /path/DatePrettyPrint.js'; DatePrettyPrint.printDate();. import DatePrettyPrint () from /path/DatePrettyPrint.js'; printDate();.

55 - A developer has the function, shown below, that is called when a page loads. function onLoad() { console.log("Page has loaded!"); } Where can the developer see the log statement after loading the page in the browser?. On the terminal console running the web server. On the webpage console log. On the browser JavaScript console. In the browser performance tools log.

56 - Given the following code: 01 let x = null; 02 console.log(typeof x); What is the output of line 02?. "object". "x". "undefined". "null".

57. runParallel ().done (function(data) { return data; });. runParallel ().then(function(data) { return data; });. runParallel ().then(data);. async runparallel().then(data);.

58. 01 class Vehicle { 02 constructor (name, price) { 03 name = name: 04 price = price; 05 } 06 priceInfo() { 07 return 'Cost of the $(this.name) is $(this.price)$"; 08 } 09 }. 01 class Vehicle { 02 constructor (name, price) { 03 this.name = name: 04 this.price = price; 05 } 06 priceInfo() { 07 return 'Cost of the $(this.name) is $(this.price)$"; 08 } 09 }. 01 class Vehicle { 02 Vehicle(name, price) { 03 this.name = name: 04 this.price = price; 05 } 06 priceInfo() { 07 return 'Cost of the $(this.name) is $(this.price)$"; 08 } 09 }. 01 class Vehicle { 02 Vehicle(name, price) { 03 this.name = name: 04 this.price = price; 05 } 06 priceInfo() { 07 return 'Cost of the $(this.name) is $(this.price)$"; 08 } 09 } No se veía xD.

59 - Given a value, which three options can a developer use to detect if the value is NaN? Choose 3 answers. value !== value. Number.isNaN(value). Object.is (value, NaN). value === Number.NaN. value == NaN.

60 - Refer to the code below: 01 async function functionUnderTest (isOK) { 02 if (isOK) return 'OK'; 03 throw new Error('not OK'); 04 } Which assertion accurately tests the above code?. console.assert (functionUnderTest (true), 'OK'). console.assert (await functionUnderTest (true), 'not OK'). console.assert (await functionUnderTest (true), 'OK'). console.assert (await(functionUnderTest (true), 'not OK')).

61 - Given the following code: let x = ('15'+ 10)* 2; What is the value of x?. 35. 1520. 3020. 50.

62. 'use strict' has an effect only on line 05. z is equal to 3.14. 'use strict' is hoisted, so it has an effect on all lines. 'use strict' has an effect between line 04 and the end of the file. Line 05 throws an error.

63. constructor() {. constructor (body, author, viewCount) (. super (body, author, viewCount) {. function story (body, author, viewCount) {.

Denunciar Test
Chistes IA