Free CRT-600 Exam Braindumps (page: 18)

Page 17 of 57

A developer wrote the following code:

01 let X = object.value;
03 try {
04 handleObjectValue(X);
05 } catch (error) {
06 handleError(error);
07 }
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 this behavior?

  1. 03 try{
    04 handleObjectValue(x);
    05 } catch(error){
    06 handleError(error);
    07 } then {
    08 getNextValue();
    09 }
  2. 03 try{
    04 handleObjectValue(x);
    05 } catch(error){
    06 handleError(error);
    07 } finally {
    08 getNextValue();
    10 }
  3. 03 try{
    04 handleObjectValue(x);
    05 } catch(error){
    06 handleError(error);
    07 }
    08 getNextValue();
  4. 03 try {
    04 handleObjectValue(x)
    05 ........................

Answer(s): D



Refer to the code:



Given the code above, which three properties are set pet1? Choose 3 answers:

  1. Name
  2. canTalk
  3. Type
  4. Owner
  5. Size

Answer(s): B,C,E



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))
.then (value => (
Let result = `$(value) the race.';)}
.catch(arr => {
console.log("Race is cancelled.", err);
});
What is the value of result when Promise.race executes?

  1. Car 3 completes the race
  2. Car 2 completed the race.
  3. Car 1 crashed in the race.
  4. Race is cancelled.

Answer(s): B



Refer to the following code:
Let sampleText = `The quick brown fox jumps';
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

  1. sampleText.includes(`fox');
  2. sampleText.includes(` quick ', 4);
  3. sampleText.includes(` Fox ', 3)
  4. sampleText.includes(` fox ');
  5. sampleText.includes(` quick ') !== -1;

Answer(s): B,D,E






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

CRT-600 Discussions & Posts