option
Cuestiones
ayuda
daypo
buscar.php

JSI

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

Descripción:
testing description

Fecha de Creación: 2023/11/15

Categoría: Otros

Número Preguntas: 40

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

1. Refer to the code below What are the values for first and second once the code executes?. first is Why and second is Where. first is Who and second is Where. first is Why and second is When. first is Why and second is When.

2. A developer wants to create an object from a function in the browser using the code below What happens due to the lack of the new keyword on line 02?. window.m is assigned the correct object. The m variable is assigned the correct object. window.name is assigned to 'hello' and the variable m remains undefined. The m variable is assigned the correct object but this.name remains undefined.

3. Refer to the following code: A developer needs to determine if a certain substring is a part of a string. Which three expressions return true for the given substring?. sampleText.substring('fox');. sampleText.indexOf('quick') ≠= -1;. sampleText.includes('Fox',3). sampleText.includes('quick',4). sampleText.includes('fox').

4. Refer to the code snippet below: What is the value of array after the code executes?. A. [1, 2, 3, 5]. B. [1, 2, 3, 4, 4, 5, 4]. C. [1, 2, 3, 4, 5, 4, 4]. D. [1, 2, 3, 4, 5, 4].

5. 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?. A. Private registries are not supported by npm, but packages can be installed via git. B. Private packages can be scoped, and scoped can be associated to a private registries. C. Private registries are not supported by npm, but packages can be installed via URL. D. Private packages are not supported, but they can use another package manager like yarn.

6. Refer to the code below: Which code executes sayHello once, two minutes from now?. A. setTimeout(sayHello, 120000);. B. setInterval(sayHello, 120000);. C. setTimeout(sayHello(), 120000);. D. delay(sayHello, 120000);.

7. Refer to the code below: What is displayed when myFunction(true) is called?. A. 2 2 1 1. B. 2 2 undefined undefined. C. 2 2 1 2. D. 2 2 2 2.

8. A developer receives a comment from the Tech Lead that the code below gives an error. Which line edit should be made to make this code run?. A. 02 let year = 2019;. B. 01 let monthName = 'July';. C. 03 if (year == 2019) {. D. 02 const year = 2020;.

9. Refer to the code below: What is the value of result when Promise.race executes?. A. Race is cancelled. B. Car 1 crashed is the race. C. Car 3 completed the race. D. Car 2 completed the race.

10. Given two expressions var1 and var2, what are two valid ways to return the logical AND of the expressions and ensure it is data type Boolean? Choose 2 answers. A. Boolean(var1 && var2). B. Boolean(var1) && Boolean(var2). C. var1.toBoolean() && var2.toBoolean(). D. var1 && var2.

11. Refer to the code below: When does Promise.finally on line 08 get called?. A. When rejected. B. When resolved. C. When resolved or rejected. D. When resolved and settled.

12. Refer to the following code: When is returned by the function call on line 13?. A. Line 13 throws an error. B. 'Undefined value!'. C. 'Null value'. D. undefined.

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

14. A developer creates a class that represents a blog post based on the requirements that a Post should have a body, author, and view count. The code is shown below: Which statements should be inserted in the placeholder on line 02 to allow for a variable to be set to set to a new instance of a Post with the three attributes correctly populated?. A. constructor() {. B. super(body, author, viewCount) {. C. function Post(body, author, viewCount) {. D. constructor(body, author, viewCount) {.

15. Which statement can a developer apply to increment the browser's navigation history without a page refresh?. A. window.history.pushState(newStateObject, '', null);. B. window.history.replaceState(newStateObject, '', null);. C. window.history.state.push(newStateObject);. D. window.history.pushState(newStateObject);.

17. Considering type coercion, what does the following expression evaluate to? true + '13' + NaN. A. 14. B. 'true13NaN'. C. 'true13'. D. '113NaN'.

16. Which two code snippets show working examples of a recursive function? Choose 2 answers. let countingDown = function(startNumber){ if(startNumber > 0){ console.log(startNumber) return countingDown(startNumber - 1) }else{ return startNumber } }. const factorial = numVar => { if(numVar < 0) return; if(numVar === 0) return 1 return numVar * factorial(numVar - 1) }. function factorial(numVar){ if(numVar < 0) return; if(numVar === 0) return 1 return numVar - 1 }. const sumtoTen = numVar => { if(numVar < 0) return; return sumtoTen(numVar + 1) }.

18. Refer to the HTML below: Which expression outputs the screen width of the element with the ID card-01?. A. document.getElementById('card-01').innerHTML.length*6. B. document.getElementById('card-01').getBoundingClientRect().width. C. document.getElementById('card-01').width. D. document.getElementById('card-01').style.width.

19. A developer has code that calculates a restaurant bill, but generates incorrect answers while testing the code. Which option allows the developer to step into each function execution within calculateBill?. A. Using the debugger command on line 03. B. Using the debugger command on line 05. C. Wrapping findSubtotal in a console.log() method. D. Calling the console.trace(total) method on line 03.

20. Refer to the following object: How can a developer access the fullName property for cat?. A. cat.get.fullName. B. cat.fullName. C. cat.fullName(). D. cat.function.fullName().

21. 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?. server.on('error', (error) => { console.log('ERROR', error) }). try{ server.start() }catch(error){ console.log('ERROR', error) }. server.error((error) => { console.log('ERROR', error) }). server.catch((error) => { console.log('ERROR', error) }).

23. A developer uses a parsed JSON string to work with user information as in the block below: Which two options access the email attribute in the object? Choose 2 answers. A. userInformation.get("email"). B. userInformation["email"]. C. userInformation[email]. D. userInformation.email.

24. A developer is wondering whether to use, Promise.then or Promise.catch, especially when a promise throws an error. Which two promises are rejected: Choose 2 answers. A. new Promise(() ⇒ {throw 'Cool error here'}).then((null, error ⇒ console.error(error)));. B. new Promise((resolve, reject) ⇒ {throw 'Cool error here'}).catch(error ⇒ console.error(error));. C. Promise.reject('Cool error here').then(error ⇒ console.error(error));. D. Promise.reject('Cool error here').catch(error ⇒ console.error(error));.

25. Universal Containers(UC) just launched a new landing page, but users complains that the website is slow. A developer found some functions that might cause this problem. To verify this, the developer decides to execute everything and log the time each of these three suspicious functions consumes. Which function can the developer use to obtain the time spent by every one of the three functions?. A. console.timeLog(). B. console.getTime(). C. console.trace(). D. console.timeStamp().

26. Given a value, which two options can a developer use to detect if the vaule is NaN? Choose 2 answers. A. isNaN(value). B. value == NaN. C. Object.is(value, NaN). D. value === Number.NaN.

27. Refer to the following code that imports a module named Utils: 01 import {foo,bar} from 'path/Utils.js'; 02 foo(); 03 bar(); Which two implementations of Utils.js export foo and bar such that the code above runs without error Choose 2 answers. const foo = () => {return 'foo'} const bar = () => {return 'bar'} export default foo, bar;. const foo = () => {return 'foo'} const bar = () => {return 'bar'} export {foo, bar}. //FooUtils.js and BarUtils.js exist import {foo} from '/path/FooUtils.js' import {bar} from '/path/BarUtils.js' export {foo, bar}. export default class { foo() {return 'foo'; } bar() {return 'bar';} }.

28. Cloud Kicks has a class to represent items for sale in a online store, as show below: A. class ClothingItem {. B. class ClothingItem extends Item {. C. class ClothingItem implements Item {. D. class ClothingItem super Item {.

29. Refer to the code below. 01 let str = 'javascript' 02 str[0] = 'J' 03 str[4] = 'S' After changing the string index values, the value of str is 'javascript'. What is the reason for this value?. A. Primitive values are immutable. B. Non-primitive values are immutable. C. Non-primitive values are mutable. D. Primitive values are mutable.

30. Refer to the code below Why does the function bar have access to variable a?. A. Outer function's scope. B. Prototype chain. C. Inner function's scope. D. Hoisting.

31. A test has dependency on database.query. During the test the dependency is replaced with an object called database with the meethod 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. A. Integration. B. White box. C. Mocking. D. Black box.

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

33. Refer to the code below: Considering the implications of 'use strict' on line 04, which three statements describe the execution of the code? Choose 3 answers. A. z is equal to 3.14. B. Line 05 throws an error. C. 'use strict' is hoisted, so it has an effect on all lines. D. 'use strict' has an effect between line 04 an the end of the file. E. 'use strict' has an effect only on line 05.

34. Which three statements are true about promises? Choose 3 answers. A. A fulfilled or rejected promise will not change states. B. The executor of a new Promise runs automatically. C. A pending promise can became fulfilled, settled or rejected. D. A settled promise can become resolved. E. A promise has a .then() method.

What is the result of the code block?. A. The console logs only 'flag'. B. The console logs 'flag' and then an error is thrown. C. An error is thrown. D. The console logs 'flag' and 'another flag'.

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

Given the code above, which three properties are set for pet1? Choose 3 answers. A. name. B. size. C. type. D. canTalk. E. owner.

38. The developer wants to test the array shown: const err = Array(5).fill(0) Which two tests are the most accurate for this array? Choose 2 answers. A. console.assert( arr.length === 5 ). B. console.assert( arr[0] === 0 && arr[ arr.length ] === 0 ). C. console.assert( arr.length > 0 ). D. arr.forEach( elem ⇒ console.assert( elem === 0 ) ).

39. A developer has the function, shown below, that is called when page loads function onLoad() { console.log('Page has loaded!') } Where can the developer see the log statement after loading the page in the browser?. A. Terminal running the web server. B. Browser performance tools. C. Browser Javascript console. D. On the webpage.

40. Which option is a core Node.js module?. A. locale. B. path. C. memory. D. ios.

41. Given the following code Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a button on the page is clicked?. A. e.nodeTarget == this. B. event.target.nodeName == 'BUTTON'. C. button.addEventListener('click'). D. event.clicked.

Denunciar Test