Free CRT-600 Exam Braindumps (page: 7)

Page 6 of 57

A developer is required to write a function that calculates the sum of elements in an array but is getting undefined every time the code is executed. The developer needs to find what is missing in the code below.
Const sumFunction = arr => {
Return arr.reduce((result, current) => {
//
Result += current;
//
), 10);
);
Which option makes the code work as expected?

  1. Replace line 02 with return arr.map(( result, current) => (
  2. Replace line 04 with result = result +current;
  3. Replace line 03 with if(arr.length == 0 ) ( return 0; )
  4. Replace line 05 with return result;

Answer(s): D



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?

  1. 2 1 4 3 5
  2. 2 5 1 3 4
  3. 1 2 4 3 5
  4. 1 2 5 3 4

Answer(s): B



Which statement accurately describes the behaviour of the async/ await keyworks ?

  1. The associated class contains some asynchronous functions.
  2. The associated function will always return a promise
  3. The associated function can only be called via asynchronous methods
  4. The associated sometimes returns a promise.

Answer(s): B



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 ?

  1. node -i index.js
  2. Node --inspect-brk index.js
  3. Node inspect index.js
  4. Node --inspect index.js

Answer(s): D






Post your Comments and Discuss Salesforce CRT-600 exam with other Community members:

CRT-600 Discussions & Posts