option
Cuestiones
ayuda
daypo
buscar.php

tuputamadredaypo

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

Descripción:
asdfasf asfeawef adsa fsf

Fecha de Creación: 2025/12/21

Categoría: Otros

Número Preguntas: 102

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

A developer is wondering whether to use, Promise.then or Promise.catch, especially when a Promise throws an error? Which two promises are rejected? Which 2 are correct?. promise.reject(‘cool error here’).then(error => console.error(error));. Promise.reject(‘cool error here’).catch(error => console.error(error));. New Promise((resolve, reject) => (throw ‘cool error here’}).catch(error => console.error(error)) ;. New Promise(() => (throw ‘cool error here’}).then(null, error => console.error(error)));.

A developer at Universal Containers creates a new landing page based on HTML, CSS, and JavaScript TO ensure that visitors have a good experience, a script named personaliseContext needs to be executed when the webpage is fully loaded (HTML content and all related files ), in order to do some custom initialization. Which statement should beused to call personalizeWebsiteContent based on the above business requirement?. document.addEventListener(‘’onDOMContextLoaded’, personalizeWebsiteContext);. window.addEventListener(‘load’,personalizeWebsiteContext);. window.addEventListener(‘onload’, personalizeWebsiteContext);. Document.addEventListener(‘‘’DOMContextLoaded’ , personalizeWebsiteContext);.

A team that works on a big project uses npm to deal with projects dependencies. A developer added a dependency does not get downloaded when they executenpm install. Which two reasons could be possible explanations for this? Choose 2 answers. The developer missed the option --add when adding the dependency. The developer added the dependency as a dev dependency, and NODE_ENVIs set to production. The developer missed the option --save when adding the dependency. The developer added the dependency as a dev dependency, and NODE_ENV is set to production.

A developer creates an object where its properties should be immutable and prevent properties from being added or modified. Which method shouldbe used to execute this business requirement ?. Object.const(). Object.eval(). Object.lock(). Object.freeze().

A developer is creating a simple webpage with a button. When a userclicks this button for the first time, a message is displayed. The developer wrote the JavaScript code below, but something is missing. The message gets displayed every time a user clicks the button, instead of just the firsttime. function listen(event){ alert('hey! i am john doe');} button.addEventListener('click', listen) Which two code lines make this code work as required? Choose 2 answers. On line 02, use event.first to test if it is the first execution. On line 04, useevent.stopPropagation ( ),. On line 04, use button.removeEventListener(‘ click” , listen);. On line 06, add an option called once to button.addEventListener();.

developer is trying to convince management that their team will benefit from using Node.js for a backend server that they are going to create. The server will be a web server that handles API requests from a website that the team has already built using HTML, CSS, and JavaScript. Which three benefits of Node.js can the developer use to persuade their manager? Choose 3 answers: I nstalls with its own package manager toinstall and manage third-party libraries. Ensures stability with one major release every few years. Performs a static analysis on code before execution to look for runtime errors. Executes server-side JavaScript code to avoid learning a new language. User non blocking functionality for performant request handling .

Refer to the code below: const event = new CustomEvent( //Missing Code ); 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. ‘Update’ , ( recordId : ‘123abc’ (. ‘Update’ , ‘123abc’. { type : ‘update’, recordId : ‘123abc’ }. ‘Update’ , { Details : { recordId : ‘123abc’}}.

Refer to the code below: Let car1 = new Promise((_ , reject) => setTimeout(reject, 2000, “car 1 crashed in” => Let car2 =new Promise(resolve => setTimeout(resolve, 1500, “car 2 completed”) Let car3 =new Promise(resolve => setTimeout(resolve, 3000, “car 3 completed”) Promise.race(( car1, car2, car3)) .t hen (value => ( Let result = ‘$(value) the race.’;)} .catch(arr => { console.log(“Race is cancelled.”, err); }); What isthe value of result when Promise.race executes?. Car 3 completes the race. Car 2 completes the race. Car 1 completes the race. Race is cancelled.

Given the code below: Function myFunction(){ A =5; Var b =1; } myFunction(); console.log(a); console.log(b); What is the expected output?. Both lines 08 and 09 are executed, and the variables are outputted. Line 08outputs the variable, but line 09 throws an error. Line 08 thrones an error, therefore line 09 is never executed. Both lines 08 and 09 are executed, but values outputted are undefined.

Given the following code: Let x =null; console.log(typeof x); What is the output of the line 02?. Null. X. Object. Undefined.

Referto the code below: Const pi = 3.1415326, What is the data type of pi?. Double. Number. Decimal. Float.

A developer wants to iterate through an array of objects and count the objects and count the objects whose property value, name, starts with the letter N. Const arrObj = [{“name” : “Zach”} , {“name” : “Kate”},{“name” : “Alise”},{“name” : “Bob”},{“name” : “Natham”},{“name” : “nathaniel”} Refer to the code snippet below: 01 arrObj.reduce(( acc, curr) => { 02 //missing line 02 2 //missing line 03 04 ).0); Which missing lines 02 and 03 return the correct count?. Const sum = curr.startsWIth('N') ? 1: 0; Return curr+ sum. Const sum = curr.name.startsWIth('N') ? 1: 0; Return curr+ sum. Const sum = curr.name.startsWith('N') ? 1: 0; Return acc +sum. Const sum = curr.startsWith('N') ? 1: 0; Return acc +sum.

Refer to code below: Const objBook = { Title: ‘Javascript’, }; Object.preventExtensions(objBook); ConstnewObjBook = objBook; newObjectBook.author = ‘Robert’; What are the values of objBook and newObjBook respectively. [title: “javaScript”] [title: “javaScript”]. {author: “Robert”, title: “javaScript} Undefined. {author: “Robert”, title: “javaScript}{author: “Robert”, title: “javaScript}. {author: “Robert”}{author: “Robert”, title: “javaScript.

Refer to the code below: Line 05 causes an error. What are the values of greeting and salutation once code completes?. Greeting is Hello and salutation is Hello, Hello. Greeting is Goodbye and salutation is Hello, Hello. Greeting is Goodbye and salutation is I say Hello. Greeting is Hello and salutation is I say hello.

A test has a dependency on database. query. During the test, the dependency is replaced with an object called database with the method, Calculator query, that returns an array. The developer does notneed to verify h. White box. Stubbing. Black box. Substitution.

A developer wants to use a module named universalContainersLib and then call functions from it. How should a developer import every function from the module and then call the functions foo and bar?. import * from '/path/universalContainersLib.js'; universalContainersLi foo ()7 universalContainersLib.bar ();. import {foo,bar} from '/path/universalCcontainersLib.js'; foo():bar()?. import all from '/path/universalContainersLib.js'; universalContainersLib.foo(); universalContainersLib.bar ();. import * as lib from '/path/universalContainersLib.js'; lib.foo();li bar ();.

developer publishes a new version of a package with new features that do not break backward compatibility. The previous version number was 1.1.3. Following semantic versioning format, what should the new package version number be?. 2.0.0. 1.2.3. 1.1.4. 1.2.0.

Refer to the code below: Which two statements correctly execute the runParallel () function? Choose 2 answers. Async runParallel () .then(data);. . runParallel ( ). done(function(data){ return data;});. runParallel () .then(data). runParallel () .then(function(data) return data.

Universal Containers (UC) notices that its application that allows users to search for accounts makes a network request each time a key is pressed. This results in too many requests for the server to handle. Address this problem, UCdecides to implement a debounce function on string change handler. What are three key steps to implement this debounce function? Choose 3 answers: If there is an existing setTimeout and the search string change, allow the existingsetTimeout to finish,and do not enqueue a new setTimeout. When the search string changes, enqueue the request within a setTimeout. Ensure that the network request has the property debounce set to true. If there is an existing setTimeout and the search string changes,cancel the existing setTimeout using the persisted timerId and replace it with a new setTimeout. Store the timeId of the setTimeout last enqueued by the search string change handle.

Which statement adds the priority = account CSS class to the universal COntainers row ?. Which statement adds the priority = account CSS class to the universal COntainers row ?. Document .queryElementById(‘row-uc’).addclass(‘priority-account’);. Document .querySelector(‘#row-uc’).classList.add(‘priority-account’);. Document .querySelectorALL(‘#row-uc’).classList.add(‘priority-account’);.

Universal Containers recently launched its new landing page to host a crowd-funding campaign. The page uses an external library to display some third-party ads. Once the page is fully loaded, it creates more than 50 new HTML items placed randomly inside the DOM, like the one in the code below: All the elements includes the same ad-library-item class, They are hidden by default, and they are randomly displayed while the user navigates through the page. Use the DOM inspector to prevent the load event to be fired. Use the browser to execute a script that removes all the element containing the class ad-library-item. Use the DOM inspector to remove all the elements containing the class ad-library-item. Use the browser console to execute a script that prevents the load event to be fired.

Universal Container(UC) just launched a new landing page, but users complain that the website is slow. A developer found some functions that cause this problem. To verify this, the developer decides to do everything and log the time each of these three suspicious functions consumes. console.time(‘Performance’); maybeAHeavyFunction(); thisCouldTakeTooLong(); orMaybeThisOne(); console.endTime(‘Performance’); Which function can the developer use to obtain the time spent by every one of the three functions?. console.timeLog(). console.getTime(). console.trace(). console.timeStamp().

Refer to the code below: Let foodMenu1 =[‘pizza’, ‘burger’, ‘French fries’]; Let finalMenu = foodMenu1; finalMenu.push(‘Garlic bread’); What is the value of foodMenu1 after the code executes?. [ ‘pizza’,’Burger’, ‘French fires’, ‘Garlic bread’]. [ ‘pizza’,’Burger’, ‘French fires’]. [ ‘Garlic bread’ , ‘pizza’,’Burger’, ‘French fires’ ]. [ ‘Garlic bread’].

Refer to the code snippet below: Let array = [1, 2, 3, 4,4, 5, 4, 4]; For (let i =0; i < array.length; i++){ if (array[i] === 4) { array.splice(i, 1); } }. [1, 2, 3, 4, 5, 4, 4]. [1, 2, 3, 4, 4, 5, 4]. [1, 2, 3, 4, 5, 4]. [1, 2, 3, 5].

Refer to the code below: return arr.reduce... What is the output of this function when called with an empty array?. Returns 0. Throws an error. Returns 10. Returns NaN.

Refer to code below: console.log(0); setTimeout(() => ( console.log(1); }); console.log(2); setTimeout(() => { console.log(3); ), 0); console.log(4); In which sequence will the numbers be logged?. 01234. 02431. 02413. 13024.

A developer has a formatName function that takes two arguments, firstName and lastName and returns a string. They want to schedule the function to run once after five seconds. What is the correct syntax to schedule this function?. setTimeout (formatName(), 5000, "John", "BDoe");. setTimeout (formatName('John', ‘'Doe'), 5000);. setTimout(() => { formatName("John', 'Doe') }, 5000);. setTimeout ('formatName', 5000, 'John", "Doe');.

Refer to the code below: for(let number =2 ; number <= 5 ; number += 1 ) { // insert code statement here } Thedeveloper needs to insert a code statement in the location shown. The code statement has these requirements: * 1. Does require an import * 2. Logs an error when the boolean statement evaluates to false * 3. Works in both the browser and Node.js Which meet the requirements?. assert (number % 2 === 0);. console.error(number % 2 === 0);. console.debug(number % 2 === 0);. console.assert(number % 2 === 0);.

Refer to code below: Let productSKU = ‘8675309’ ; A developer has a requirement to generate SKU numbers that are always 19 characters lon, starting with ‘sku’,and padded with zeros. Which statement assigns the values sku0000000008675309 ?. productSKU = productSKU .padStart (19. ‘0’).padstart(‘sku’);. productSKU = productSKU .padEnd (16. ‘0’).padstart(‘sku’). productSKU = productSKU .padEnd (16. ‘0’).padstart(19, ‘sku’);. productSKU = productSKU .padStart (16. ‘0’).padstart(19, ‘sku’);.

A developer has an ErrorHandler module that contains multiple functions. What kind of export be leverages sothat multiple functions can be used?. Named. All. Multi. Default.

Cloud Kicks has a class to represent items for sale in an online store, as shownbelow: Class Item{ constructor (name, price){ this.name = name; this.price = price; } formattedPrice(){ return ‘s’ + String(this.price);}} A new business requirement comes in that requests a ClothingItem class that should have all of the properties and methods of the Item class but will also have properties that are specific to clothes. Which line of code properly declares the clothingItem class such that it inherits from Item?. Class ClothingItem implements Item{. Class ClothingItem {. Class ClothingItem super Item {. Class ClothingItem extends Item {.

Refer to code below: let first = 'Who'; let second = 'What'; try{ try{ throw new Error('Sad trombone'); }catch(err){ first = 'Why'; NO LANZA ERROR AQUI POR LO QUE VA AAL FIALLy }finally{ second = 'When' } }catch(err){ second = 'Where' } What are the values for first and second once the code executes ?. First is Who and second is When. First is why and second is where. First is who and second is where. First is why andsecond is when.

eveloper has a web server running with Node.js. The command to start the web server is node server,js. The web server started having latency issues. Instead of a one second turn around for web requests, the developer now sees a five second turnaround, Which command can the web developer run to see what the module is doing during the latency period?. DEBUG = http, https node server.js. NODE_DEBUG =http, https node server.js. DEBUG =true node server.js. NODE_DEBUG =true node server.js.

A developer implements and calls the following code when an application state change occurs: Const onStateChange =innerPageState) => { window.history.pushState(newPageState, ‘ ’, null); } If the back button is clicked after this method is executed, what can a developer expect?. A navigate event is fired with a state property that details the previous application state. The page is navigated away from and the previous page in the browser’s history is loaded. The page reloads and all Javascript is reinitialized. A popstate event is fired with a state property that details the application’s last state.

A developer creates a generic function to log custom messages in the console. To do this, the function below is implemented. Which three console logging methods allow the use of string substitution in line 02?. Assert. Log. Message. Info. Error.

Refer to the code below: new Promise((resolve, reject) => { const fraction = Math.random(); if( fraction >0.5) reject("fraction > 0.5, " + fraction); resolve(fraction); }) .then(() =>console.log("resolved")) .catch((error) => console.error(error)) .finally(() => console.log(" when am I called?")); When does Promise.finally on line 08 get called?. When rejected. When resolved and settled. WHen resolved. WHen resolved or rejected.

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 = () =>{ 8 console.log(‘They\’re great1’); 9 }; 10 11 function Lion(){ 12 this.type = ‘Cat’; 13this.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.roar = () => { console.log(‘They\’re pretty good:’); };. Object.assign(leo,Tiger). Object.assign(leo,tony);. Leo.prototype.roar = () => { console.log(‘They\’re pretty good:’); }.

Why would a developer specify a package.jason as a developed forge instead of a dependency ?. It is required by the application in production. It is only needed for local development and testing. Other requiredpackages depend on it for development. It should be bundled when the package is published.

A developer creates a simple webpage with an input field. Whena 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> The developer wrote the javascript code below: Const button = document.querySelector(‘button’); button.addEvenListener(‘click’, () => ( Const input = document.querySelector(‘input’); console.log(input.getAttribute(‘value’)); When the user clicks the button, the output is always “Hello”. What needs to be done make this code work as expected?. Replace line 04 with console.log(input .value);. Replace line 03 with const input = document.getElementByName(‘input’);. Replace line 02 with button.addEventListener(“onclick”, function() {. Replace line 02 with button.addCallback(“click”, function() {.

Which three options show valid methods for creating a fat arrowfunction? Choose 3 answers. x => ( console.log(‘ executed ’) ; ). [ ] => ( console.log(‘ executed ’) ;). ( ) => ( console.log(‘ executed ’) ;). X,y,z => ( console.log(‘ executed ’) ;). (x,y,z) => ( console.log(‘ executed ’) ;).

Refer to the code below: What is the value of result when the code executes?. 10-10. asdfasdf.

A developer is debugging a web server that uses Node.js The server hits a runtimeerror every third request to an important endpoint on the web server. The developer added a break point to the start script, that is at index.js at he root of the server’s source code. The developer wants to make use of chrome DevTools to debug. Which command can be run to access DevTools and make sure the breakdown is hit ?. node -i index.js. Node --inspect-brk index.js. Node inspect index.js. Node --inspect index.js.

Given two expressions var1 and var2. What are two valid ways to return the logical AND of the two expressions and ensure it is data typeBoolean ? Choose 2 answers: Boolean(var1 && var2). var1 && var2. var1.toBoolean() && var2toBoolean(). Boolean(var1) && Boolean(var2).

A developer is leading the creation of a new browser application that will serve a single page application. The teamwants to use a new web framework Minimalsit.js. The Lead developer wants to advocate for a more seasoned web framework that already has a community around it. Which two frameworks should the lead developer advocate for? Choose 2 answers. Vue. Angular. Koa. Express.

Refer to the code below: Async funct on functionUnderTest(isOK) { If (isOK) return ‘OK’ ; Throw new Error(‘not OK’); ) Which assertion accuretely tests the above code?. Console.assert (await functionUnderTest(true), ‘ asfOK ’). Console.assert (await functionUnderTest(true), ‘ not OK ’). Console.assert (awaitfunctionUnderTest(true), ‘ not OK ’). Console.assert (await functionUnderTest(true), ‘OK’).

Refer to the code snippet below: Let array = [1, 2, 3, 4, 4, 5, 4, 4]; For (let i =0; i < array.length; i++) if (array[i] === 4) { array.splice(i, 1); i--; } } What is the value of array after the code executes?. [1, 2, 3, 4, 5, 4, 4]. [1, 2, 3, 4, 4, 5, 4]. [1, 2, 3, 5]. [1, 2, 3, 4, 5, 4].

Refer to the following array: Let arr1 = [ 1, 2, 3, 4, 5 ]; Which two lines of code result in a second array, arr2 being created such that arr2 is not a reference to arr1?. Let arr2 = arr1.slice(0, 5);. Let arr2 = Array.from(arr1);. Letarr2 = arr1;. Let arr2 = arr1.sort();.

Refer to the code snippet: function getAvailabilityMessage(item){ if(getAvailability(item){ var msg = "username available" ; } return msg; } A developer writes this code to return a message to userattempting to register a new username. If the username is available, variable. What is the return value of msg hen getAvailabilityMessage (“newUserName” ) is executed and getAvailability(“newUserName”) returns false?. “Username available. “newUserName. “Msg is not defined”. undefined.

Refer to the following code: Let sampleText = ‘The quick brown foxjumps’; A developer needs to determine if a certain substring is part of a string. Which three expressions return true for the given substring ? Choose 3 answers. sampleText.includes(‘fox’);. sampleText.includes(‘ quick ’, 4);. sampleText.includes(‘Fox ’, 3). sampleText.includes(‘ fox ’);. sampleText.includes(‘ quick ’) !== -1;.

Refer to the code below: et o = { get js(){ let city1 = String('St. Louis'); let city2 = String('New York'); return { firstCity: city1.toLowerCase(), secondCity: city2.toLowerCase(), } } } What value can a developer expect when referencing o.js.secondCity?. Undefined. ‘ new york ’. ‘ New York ’. An error.

Refer to the code below: Let str = ‘javascript’; Str[0] = ‘J’; Str[4] = ’S’; After changing the string index values, the value of str is ‘javascript’. What is the reason for this value: Non-primitive values are mutable. Non-primitive values are immutable. Primitive values are mutable. Primitive values are immutable.

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: There is a new requirement for a developer to implement a description method that will return a brief description for Item and SaleItem. This is a Scarf Uncaught TypeError:saleItem.description is not a function This is aScarf This is a discounted Shirt. this is a Scarf This is a Shirt This is a Scarf This is a discounted Shirt.

Which three browser specific APIs are available for developers to persist data between page loads ? Choose 3 answers. IIFEs. IndexedDB. Global Variables. Cookies. LOCAL sTORAGE.

A developer needs to test this function: 01const sum3 = (arr) => ( 02if (!arr.length) return 0, 03if (arr.length === 1) return arr[0], 04if (arr.length === 2) return arr[0]+ arr[1], 05 return arr[0] + arr[1] + arr[2], 06 ); Which two assert statements are valid tests for the function? Choose 2 answers. console.assert(sum3(1, ‘2’)) == 12);. console.assert(sum3(0)) == 0);. console.assert(sum3(-3, 2 )) == -1);. console.assert(sum3(‘hello’, 2, 3, 4)) === NaN);.

Refer to the HTML below: <div id=”main”> <ul> <li>Leo</li> <li>Tony</li> <li>Tiger</li> </ul> </div> Which JavaScript statementresults in changing “ Tony” to “Mr. T.”?. document.querySelectorAll(‘$main $TONY’).innerHTML = ’ M. ocument.querySelector(‘$main li:second-child’).innerHTML = ’ M. document.querySelector(‘$main li.Tony’).innerHTML = ’ M. document.querySelector(‘$main li:nth-child(2)’),innerHTML = ’ M.

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

A developer writers the code below to calculate the factorial of a given number. function factorial(number){ return number * factorial(number-1) } factorial(3) What isthe result of executing line 04?. 6. -Infinity. RuntimeError. RangeError: Maximum call stack size exceeded.

Refer to the code below: FunctionPerson(firstName, lastName, eyecolor) { this.firstName =firstName; this.lastName = lastName; this.eyeColor = eyeColor; } Person.job = ‘Developer’; const myFather = new Person(‘John’, ‘Doe’); console.log(myFather.job); What is the output after the codeexecutes?. ReferenceError: eyeColor is not defined. . ReferenceError: assignment to undeclared variable “Person”. Developer. Undefined.

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

Given the following code: Let x =(‘15’ + 10)*2; What is the value of a?. 3020. 1520. 50. 35.

Refer to the code below? LetsearchString = ‘ look for this ’; Which two options remove the whitespace from the beginning of searchString? Choose 2 answers. searchString.trimEnd();. searchString.trimStart();. trimStart(searchString);. searchString.replace(/*\s\s*/, ‘’);.

Refer to the following code: la del foo bar con el of y el in , si es of es error si es in entra y es foo bar What is the output line 11?. [1,2]. [“bar”,”foo”. [“foo”,”bar”]. [“foo:1”,”bar:2”].

Refer to the code below: el códgio de searchText.search(/sales/). true false. 5 undefined. 5 -1. 5 > 0.

developer creates a new web server that uses Node.js. It imports aserver 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 boost with an event?. Server.catch ((server) => { console.log(‘ERROR’, error);}). Server.error ((server) => { console.log(‘ERROR’, error);});. Server.on (‘error’, (error) => { console.log(‘ERROR’, error);});. Try{server.start();} catch(error) { console.log(‘ERROR’, error);}.

developer removes the HTML class attribute from the checkout button, so now it is simply: <button>Checkout</button>. There is a test to verifythe 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. True negative. False positive. False negative.

Considering type coercion, what does the following expression evaluate to? True + ‘13’ + NaN. 113Nan. 14. ‘ true13 ’. ‘ true13NaN ’.

function Animal(size, type){ this.type = type || 'Animal'; this.size = size || 'small' this.canTalk = false; } let Pet = function(size, type, name, owner){ Animal.call(this, size, type); this.name = name; this.owner= owner; } Pet.prototype = Object.create(Animal.prototype); let pet1 = new Pet(); console.log(pet1); Given the code above, which three properties are set pet1? Choose 3answer. Name. canTalk. Type. Owner. Size.

Refer to the following code: <html lang=”en”> <body> <div onclick = “console.log(‘Outer message’) ;”> <button id =”myButton”>CLick me<button> </div> </body> <script> function displayMessage(ev) { ev.stopPropagation(); console.log(‘Inner message.’); } const elem =document.getElementById(‘myButton’); elem.addEventListener(‘click’ , displayMessage); </script> </html> What will the console show when the button is clicked?. Outer message. Outer message Inner message. Inner message Outer message. Inner message.

developer uses the code below to format a date. teniendo que está formando la fecha como 2020, 05, 10 es mayo After executing, what is the value offormattedDate?. May 10, 2020. June 10, 2020. October 05, 2020. November 05, 2020.

A test has a dependency on database.query. During the test the dependency is replaced with an object called database with the method, query, that returns an array. The developer needs to verify how many times the method was called and the arguments used each time. Which two test approaches describe the requirement? Choose 2 answers. Integration. Black box. White box. Mocking.

A developer is working on an ecommerce website where the delivery date is dynamically calculated based on the current day. The code line below is responsible for this calculation. Const deliveryDate = new Date (); Due to changes in the business requirements, the delivery date must now be today’s date + 9 days. Which code meets thisnew requirement?. deliveryDate.setDate(( new Date ( )).getDate () +9);. deliveryDate.setDate( Date.current () + 9). deliveryDate.date = new Date(+9) ;. deliveryDate.date = Date.current () + 9;.

Which two console logs output NaN? Choose 2 answers. . console.log(10 / Number('5) ) ;. console.log(parseInt ' ("two')) ;. console.log(10 / 0);. console.loeg(10 / 'five');.

Refer to the code below: Const resolveAfterMilliseconds = (ms) => Promise.resolve ( setTimeout (( => console.log(ms), ms )); Const aPromise = await resolveAfterMilliseconds(500); Const bPromise = await resolveAfterMilliseconds(500); Await aPromise, wait bPromise; What is the result of runningline 05?. aPromise and bPromise run sequentially. Neither aPromise or bPromise runs. aPromise and bPromise run in parallel. Only aPromise runs.

Which statement accurately describes the behaviour of the async/ await keyworks ?. The associated class contains some asynchronous functions. The associated function will always return apromise. The associated function can only be called via asynchronous methods. he associated sometimes returns a promise.

Teams at Universal Containers(UC) work on multiple JavaScript projects at the same time. UC is thinking about reusability and how each team can benefit from the work of others. Going open-source or public is not an option at this time. Which option is available to UC with npm?. Private packages can be scored, and scopes can be associated to a private registries. Private registries are not supported by npm, but packages can be installed via URL. Private packages are not supported, but they can use another package manager like yarn. Private registries are not supported by npm, but packages can be installed via git.

Consider type coercion, what does the following expression evaluate to? True + 3 + ‘100’ + null. 104. 4100. ‘3100null’. ‘4100null’.

Refer to the following array: Let arr = [ 1,2, 3, 4, 5]; Which three options result in x evaluating as [3, 4, 5] ? Choose 3 answers. A. Let x= arr.filter (( a) => (a<2)); B. Let x=arr.splice(2,3); C. Let x= arr.slice(2); D. Let x= arr.filter((a) => ( return a>2 ));. Let x= arr.filter (( a) => (a<2));. Let x=arr.splice(2,3);. Let x= arr.slice(2);. Let x= arr.filter((a) => ( return a>2 ));. Let x = arr.slice(2,3);.

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

A developer has code that calculates a restaurant bill, but generates incorrectanswers while testing the code: function calculateBill ( items ) { let total = 0; total += findSubTotal(items); total += addTax(total); total += addTip(total); return total; } Which option allows the developer to step into each function execution within calculateBill?. Using the debugger command on line 05. Using the debugger command on line 03. Calling the console.trace (total) method on line 03. Wrapping findSubtotal in a console.log() method.

Which statement phrases successfully? comillas simples - grandes para string. JSON.parse ( ‘ foo ’ );. JSON.parse ( “ foo ” );. JSON.parse( “ ‘ foo ’ ” );. JSON.parse(‘ “ foo ” ’);.

In which situation should a developer include a try .. catch block around their function call ?. The function has an error that shouldnot be silenced. The function results in an out of memory issue. The function might raise a runtime error that needs to be handled. The function contains scheduled code.

A developer has two ways to write a function: Option A: function Monster() { This.growl = () => { Console.log (“Grr!”); } } Option B: function Monster() {}; Monster.prototype.growl =() => { console.log(“Grr!”); } After deciding on an option, the developer creates 1000 monster objects. How many growl methods are created with Option AOption B?. Option A: Creates 1000 Option B: Creates only 1. asdfasf.

Given code below: setTimeout (() => ( console.log(1); ). 0); console.log(2); New Promise ((resolve, reject )) = > ( setTimeout(() => ( reject(console.log(3)); ). 1000); )).catch(() => ( console.log(4); )); console.log(5); What is logged to the console?. . 2 1 4 3 5. 2 5 1 3 4. 1 2 4 3 5. 1 2 5 3 4.

A developer implements a function that adds a few values. Function sum(num) { If (num == undefined) { Num =0; } Return function( num2, num3){ If (num3 === undefined) { Num3 =0 ; } Return num + num2 + num3; } } Which three options can the developer invoke for this function to get a return value of 10 ? Choose 3 answers (son solo dos). Sum () (20). Sum (5, 5) (). sum() (5, 5). sum(5)(5). sum(10) ().

What is the result of the code block? flag(); anotherFlag(); function flag(){ console.log('flag'); } const anotherFlag = () => { console.log('another flag'); } las arrow tienen que estar declaradas antes de llamarlas. The console logs only ‘flag’. The console logs ‘flag’ and another flag. An error is thrown. The console logs ‘flag’ and then an error isthrown.

A developer wants to define a function log to be used a few times on a single-file JavaScript script. 01 // Line 1 replacement 02 console.log('"LOG:', logInput); 03 } Which two options can correctly replace line 01 and declare the function for use? Choose 2 answers. function leg(logInput) {. const log(loginInput) {. const log = (logInput) => {. function log = (logInput) {.

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

A developer wants to use a try...catch statement to catch any error that countSheep () may throw and pass it to a handleError () function. What is the correct implementation of the try...catch?. try{ setTimeout(function() { countSheep(); },100); }catch(e){ handleEERROR()E}. DSFASDF.

Refer to code below: Function muFunction(reassign){ Let x = 1; var y = 1; if( reassign ) { Let x= 2; Var y = 2; console.log(x); console.log(y);} console.log(x); console.log(y);} What isdisplayed when myFunction(true) is called?. 2 2 1 1. 2 2 undefined undefined. 2 2 1 2. 2 2 2 2.

A Developer wrote the following code to test a sum3 function that takes in an array of numbers and returns the sum of the first three number in the array, The test passes: let res = sum3([1, 2,3]); console.assert(res===6); res=sum3([1,2,3,4]); console.assert(res===6); A different developer made changes to the behavior of sum3 to instead sum all of the numbers present in the array. The test passes: Which two results occur when running the test on the updated sum3 function ? Choose 2 answers. the line 02 assertion passes. The line 02 assertion fails. The line 05 assertion passes. The line 05 assertion fails.

Which javascript methods can be used to serialize an object into a string and deserialize a JSON string into an object, respectively?. JSON.stringify and JSON.parse. JSON.serialize and JSON.deserialize. JSON.encode and JSON.decode. JSON.parse and JSON.deserialize.

Refer to HTML below: <div id =”main”> <div id = “ card-00”>This card is smaller.</div> <div id = “card-01”>The width and height of this card is determined by its contents.</div> </div> Which expression outputs the screen width of the element with the ID card-01?. document.getElementById(‘ card-01 ’).getBoundingClientRest().width. document.getElementById(‘ card-01 ’).style.width. document.getElementById(‘ card-01 ’).width. document.getElementById(‘ card-01 ’).innerHTML.lenght*e.

A developer wrote the following code: 01 let X = object.value; 02 3 try { 4 handleObjectValue(X); 05 } catch (error) { 6 handleError(error); 7 } The developer has a getNextValue function to execute after handleObjectValue(), but does not want to execute getNextValue() if an error occurs. How can the developer change the code to ensure thisbehavior?. 03 try{4 handleObjectValue(x);5 } catch(error){6 handleError(error); 07 } then {8 getNextValue();9 }. 03 try{4 handleObjectValue(x);5 } catch(error){6 handleError(error); 07 } finally {08 getNextValue();10 }. 03 try{04handleObjectValue(x); 05 } catch(error){6 handleError(error);7 }8 getNextValue();. 03 try {04 handleObjectValue(x)05 …………………….

Giventhe code below: const copy = JSON.stringify([ new String(‘ false ’), new Bollean( false ), undefined ]); What is the value of copy?. [ \”false\” , { } ]-. [ false, { } ]-. [ \”false\” , false, undefined ]-. [ \”false\” ,false, null ]-.

function Person(){ this.firstName = 'John'; } Person.prototype = { job: x => 'Developer' }; const myFather = new Person(); const result = myFather.firstName + ' ' + myFather.job(); console.log(result);. Error: myFather.job is not a function. Undefined Developer. John undefined. John Develope.

Refer to the code below? LetsearchString = ‘ look for this ’; Which two options remove the whitespace from the beginning of searchString? Choose 2 answers. searchString.trimEnd();. searchString.trimStart();. trimStart(searchString);. searchString.replace(/*\s\s*/, ‘’);.

Given the following code: document.body.addEventListener(‘ click ’, (event) => { if (/* CODE REPLACEMENT HERE */) { console.log(‘button clicked!’); ) }); Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a button on page is clicked?. Event.clicked. e.nodeTarget ==this. event.target.nodeName == ‘BUTTON’. button.addEventListener(‘click’).

Refer to following code: class Vehicle { constructor(plate) { This.plate =plate; } } Class Truck extends Vehicle { constructor(plate, weight) { //Missing code This.weight = weight; } displayWeight() { console.log(‘Thetruck ${this.plate} has a weight of ${this.weight} lb.’);}} Let myTruck = new Truck(‘123AB’, 5000); myTruck.displayWeight(); Which statement should be added to line 09 for the code to display ‘The truck 123AB has a weight of 5000lb.’?. Super.plate =plate;. super(plate). This.plate =plate;. Vehicle.plate = plate;.

Refer to the expression below: Let x = (‘1’ + 2) == (6 * 2); How should this expression be modified to ensure that evaluates to false?. Let x = (‘1’ + ‘ 2’) == ( 6 * 2). Let x = (‘1’ + 2) == ( 6 * 2);. Let x = (1 + 2) == ( ‘6’ / 2);. Let x = (1 + 2 ) == ( 6 / 2);.

A developer wants to setup 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 https =require(‘https’);. const server =require(‘secure-server’);. const tls = require(‘tls’);. const http =require(‘http’);.

A developer wrote a fizzbuzz function that when passed in a number, returns the following: ‘Fizz’ if the number is divisible by 3. ‘Buzz’ if the number is divisible by 5. ‘Fizzbuzz’ if the number is divisible by both 3 and 5. Emptystring if the number is divisible by neither 3 or 5. Which two test cases will properly test scenarios for the fizzbuzz function? Choose 2 answers. let res = fizzbuzz(5); console.assert ( res === ‘ ’ );. let res = fizzbuzz(15);console.assert ( res ===‘ fizzbuzz ’ ). let res = fizzbuzz(Infinity); console.assert ( res === ‘ ’ ). let res = fizzbuzz(3); console.assert ( res === ‘ buzz ’ ).

What are two unique features of functions defined with a fat arrow as compared to normal function definition? Choose 2 answers. The function generated its own this making ituseful for separating the function’s scope from its enclosing scope. The function receives an argument that is always in scope, called parentThis, which is the enclosing lexical scop. If the function has a single expression in the function body, the expression will be evaluated and implicit returned. The function uses the this from the enclosing scope.

Denunciar Test