Available in 1, 3, 6 and 12 Months Free Updates Plans
PDF: $15 $60

Test Engine: $20 $80

PDF + Engine: $25 $99

JavaScript-Developer-I Practice Test


Page 2 out of 45 Pages

Developer wants to use a module named universalContainersLib and them call functions from it.
How should a developer import every function from the module and then call the fuctions foo and bar ?


A. import * ad lib from ‘/path/universalContainersLib.js’;
lib.foo();
lib.bar();


B. import (foo, bar) from ‘/path/universalContainersLib.js’;
foo();
bar();


C. import all from ‘/path/universalContaineraLib.js’;
universalContainersLib.foo();
universalContainersLib.bar();


D. import * from ‘/path/universalContaineraLib.js’;
universalContainersLib.foo();
universalContainersLib.bar();





A.
  import * ad lib from ‘/path/universalContainersLib.js’;
lib.foo();
lib.bar();


A developer is asked to fix some bugs reported by users. To do that, the developer adds a breakpoint for debugging. Function Car (maxSpeed, color){
This.maxspeed =masSpeed;
This.color = color;
Let carSpeed = document.getElementById(‘ CarSpeed’);
Debugger;
Let fourWheels =new Car (carSpeed.value, ‘red’);
When the code execution stops at the breakpoint on line 06, which two types of information are available in the browser console ? Choose 2 answers:


A. The values of the carSpeed and fourWheels variables


B. A variable displaying the number of instances created for the Car Object.


C. The style, event listeners and other attributes applied to the carSpeed DOM element


D. The information stored in the window.localStorage property





C.
  The style, event listeners and other attributes applied to the carSpeed DOM element

D.
  The information stored in the window.localStorage property

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


A. Integration


B. Black box


C. White box


D. Mocking





C.
  White box

D.
  Mocking

Refer to the following code that imports a module named utils:
import (foo, bar) from ‘/path/Utils.js’;
foo() ;
bar() ;
Which two implementations of Utils.js export foo and bar such that the code above runs
without
error?
Choose 2 answers


A.

// FooUtils.js and BarUtils.js exist
Import (foo) from ‘/path/FooUtils.js’;
Import (boo) from ‘ /path/NarUtils.js’;


B.

const foo = () => { return ‘foo’ ; }
const bar = () => { return ‘bar’ ; }
export { bar, foo }


C.

Export default class {
foo() { return ‘foo’ ; }
bar() { return ‘bar’ ; }
}


D.

const foo = () => { return ‘foo’;}
const bar = () => {return ‘bar’; }
Export default foo, bar;





B.
  

const foo = () => { return ‘foo’ ; }
const bar = () => { return ‘bar’ ; }
export { bar, foo }



C.
  

Export default class {
foo() { return ‘foo’ ; }
bar() { return ‘bar’ ; }
}



Given the following code:
Counter = 0;
const logCounter = () => {
console.log(counter);
);
logCounter();
setTimeout(logCOunter, 1100);
setInterval(() => {
Counter++
logCounter();
}, 1000);
What is logged by the first four log statements?


A. A. 0 0 1 2


B. 0 1 2 3


C. 0 1 1 2


D. 0 1 2 2





C.
  0 1 1 2


Page 2 out of 45 Pages
Previous