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 execute npm install.
Which two reasons could be possible explanations for this?
Choose 2 answers
A. The developer missed the option --add when adding the dependency.
B. The developer added the dependency as a dev dependency, and NODE_ENV Is set to production.
C. The developer missed the option --save when adding the dependency.
D. The developer added the dependency as a dev dependency, and
NODE_ENV is set to production.
Refer to the HTML below:
Leo
Tony
Tiger
Which JavaScript statement results in changing “ Tony” to “Mr. T.”?
A. document.querySelectorAll(‘$main $TONY’).innerHTML = ’ Mr. T. ’;
B. document.querySelector(‘$main li:second-child’).innerHTML = ’ Mr. T. ’;
C. document.querySelector(‘$main li.Tony’).innerHTML = ’ Mr. T. ’;
D. document.querySelector(‘$main li:nth-child(2)’),innerHTML = ’ Mr. T. ’;
Refer to the code below:
Const searchTest = ‘Yay! Salesforce is amazing!” ;
Let result1 = searchText.search(/sales/i);
Let result 21 = searchText.search(/sales/i);
console.log(result1);
console.log(result2);
After running this code, which result is displayed on the console?
A. > true > false B. > 5 >undefined
B. > 5 > -1
C. > 5 > 0
Refer to code below:
Const objBook = {
Title: ‘Javascript’,
};
Object.preventExtensions(objBook);
Const newObjBook = objBook;
newObjectBook.author = ‘Robert’;
What are the values of objBook and newObjBook respectively ?
A. [title: “javaScript”] [title: “javaScript”]
B. {author: “Robert”, title: “javaScript}
Undefined
C. {author: “Robert”, title: “javaScript}
{author: “Robert”, title: “javaScript}
D. {author: “Robert”}
{author: “Robert”, title: “javaScript}
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
A. function leg(logInput) {
B. const log(loginInput) {
C. const log = (logInput) => {
D. function log = (logInput) {
Refer to the code below:
Function changeValue(obj) {
Obj.value = obj.value/2;
}
Const objA = (value: 10);
Const objB = objA;
changeValue(objB);
Const result = objA.value;
What is the value of result after the code executes?
A. 10
B. Nan
C. 5
D. Undefined
developer uses the code below to format a date.
let timerId = setTimeout (timedFunction, 1000);
Which statement allows a developer to cancel the scheduled timed function?
A. A. removeTimeout(timedFunction);
B. removeTimeout(timerId);
C. clearTimeout(timerId);
D. clearTimeout(timedFunction);
let timerId = setTimeout (timedFunction, 1000);
Which statement allows a developer to cancel the scheduled timed function?
A. removeTimeout(timedFunction);
B. removeTimeout(timerId);
C. clearTimeout(timerId);
D. clearTimeout(timedFunction);
Refer to the code below:
let sayHello = () => {
console.log (‘Hello, world!’);
};
Which code executes sayHello once, two minutes from now?
A. setTimeout(sayHello, 12000);
B. setInterval(sayHello, 12000);
C. setTimeout(sayHello(), 12000);
D. delay(sayHello, 12000);
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, UC decides to implement a debounce function on string change handler.
What are three key steps to implement this debounce function?
Choose 3 answers:
A. If there is an existing setTimeout and the search string change, allow the existing setTimeout to finish, and do not enqueue a new setTimeout.
B. When the search string changes, enqueue the request within a setTimeout.
C. Ensure that the network request has the property debounce set to true.
D. 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.
E. Store the timeId of the setTimeout last enqueued by the search string change handle.
A developer 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 turnaround 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?
A. NODE_DEBUG=true node server.js
B. DEBUG=http, https node server.js
C. NODE_DEBUG=http,https node server.js
D. DEBUG=true node server.js
Refer to the code below: Line 05 causes an error.
What are the values of greeting and salutation once code completes?
A. Greeting is Hello and salutation is Hello, Hello.
B. Greeting is Goodbye and salutation is Hello, Hello.
C. Greeting is Goodbye and salutation is I say Hello.
D. >Greeting is Hello and salutation is I say hello.
Page 7 out of 19 Pages |
Previous |