[UPDATED 2022] Salesforce CRT-600 Questions Prepare with Free Demo of PDF [Q28-Q46]

Share

[UPDATED 2022] Salesforce CRT-600 Questions Prepare with Free Demo of PDF

NEW 2022 Certification Sample Questions CRT-600 Dumps & Practice Exam

NEW QUESTION 28
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 > -1
  • C. > 5 > 0
  • D. > 5 >undefined

Answer: D

Explanation:

 

NEW QUESTION 29
A developer wants to leverage a module to print a price in pretty format, and has imported a method as shown below:
Import printPrice from '/path/PricePrettyPrint.js';
Based on the code, what must be true about the printPrice function of the PricePrettyPrint module for this import to work ?

  • A. printPrice must be be a named export
  • B. printPrice must be the default export
  • C. printPrice must be an all export
  • D. printPrice must be a multi exportc

Answer: B

 

NEW QUESTION 30
Why would a developer specify a package.jason as a developed forge instead of a dependency ?

  • A. It should be bundled when the package is published.
  • B. It is only needed for local development and testing.
  • C. Other required packages depend on it for development.
  • D. It is required by the application in production.

Answer: B

 

NEW QUESTION 31
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. Store the timeId of the setTimeout last enqueued by the search string change handle.
  • B. 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.
  • C. When the search string changes, enqueue the request within a setTimeout.
  • D. If there is an existing setTimeout and the search string change, allow the existing setTimeout to finish, and do not enqueue a new setTimeout.
  • E. Ensure that the network request has the property debounce set to true.

Answer: C,D,E

 

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

Answer: D

 

NEW QUESTION 33
Given two expressions var1 and var2. What are two valid ways to return the logical AND of the two expressions and ensure it is data type Boolean ?
Choose 2 answers:

  • A. var1 && var2
  • B. var1.toBoolean() && var2toBoolean()
  • C. Boolean(var1) && Boolean(var2)
  • D. Boolean(var1 && var2)

Answer: C,D

 

NEW QUESTION 34
Which javascript methods can be used to serialize an object into a string and deserialize a JSON string into an object, respectively?

  • A. JSON.parse and JSON.deserialize
  • B. JSON.stringify and JSON.parse
  • C. JSON.serialize and JSON.deserialize
  • D. JSON.encode and JSON.decode

Answer: B

 

NEW QUESTION 35
In which situation should a developer include a try .. catch block around their function call ?

  • A. The function might raise a runtime error that needs to be handled.
  • B. The function contains scheduled code.
  • C. The function results in an out of memory issue.
  • D. The function has an error that should not be silenced.

Answer: A

 

NEW QUESTION 36
A developer has code that calculates a restaurant bill, but generates incorrect answers while testing the code:
function calculateBill ( items ) {
let total = 0;
total += findSubTotal(items);
total += addTax(total);
total += addTip(total);
return total;
}
Which option allows the developer to step into each function execution within calculateBill?

  • A. Wrapping findSubtotal in a console.log() method.
  • B. Using the debugger command on line 03
  • C. Using the debugger command on line 05.
  • D. Calling the console.trace (total) method on line 03.

Answer: C

 

NEW QUESTION 37
Given the code below:
01 function GameConsole (name) {
02 this.name = name;
03 }
04
05 GameConsole.prototype.load = function(gamename) {
06 console.log( ` $(this.name) is loading a game : $(gamename) ...`);
07 )
08 function Console 16 Bit (name) {
09 GameConsole.call(this, name) ;
10 }
11 Console16bit.prototype = Object.create ( GameConsole.prototype) ;
12 //insert code here
13 console.log( ` $(this.name) is loading a cartridge game : $(gamename) ...`);
14 }
15 const console16bit = new Console16bit(' SNEGeneziz ');
16 console16bit.load(' Super Nonic 3x Force ');
What should a developer insert at line 15 to output the following message using the method ?
> SNEGeneziz is loading a cartridge game: Super Monic 3x Force . . .

  • A. Console16bit.prototype.load(gamename) {
  • B. Console16bit.prototype.load(gamename) = function() {
  • C. Console16bit = Object.create(GameConsole.prototype).load = function
    (gamename) {
  • D. Console16bit.prototype.load = function(gamename) {

Answer: D

 

NEW QUESTION 38
Refer to the following code that performs a basic mathematical operation on a provided input:
function calculate(num) {
Return (num +10) / 3;
}
How should line 02 be written to ensure that x evaluates to 6 in the line below?
Let x = calculate (8);

  • A. Return (Number (num +10 ) / 3;
  • B. Return Number((num +10) /3 );
  • C. Return Integer(num +10) /3;
  • D. Return Number(num + 10) / 3;

Answer: A

 

NEW QUESTION 39
Refer to the code below:
new Promise((resolve, reject) => {
const fraction = Math.random();
if( fraction >0.5) reject("fraction > 0.5, " + fraction);
resolve(fraction);
})
.then(() =>console.log("resolved"))
.catch((error) => console.error(error))
.finally(() => console.log(" when am I called?"));

When does Promise.finally on line 08 get called?

  • A. When rejected
  • B. When resolved or rejected
  • C. WHen resolved
  • D. When resolved and settled

Answer: B

 

NEW QUESTION 40
is below:
<input type="file" onchange="previewFile()">
<img src="" height="200" alt="Image Preview..."/>
The JavaScript portion is:
01 function previewFile(){
02 const preview = document.querySelector('img');
03 const file = document.querySelector('input[type=file]').files[0];
04 //line 4 code
05 reader.addEventListener("load", () => {
06 preview.src = reader.result;
07 },false);
08 //line 8 code
09 }
In lines 04 and 08, which code allows the user to select an image from their local computer , and to display the image in the browser?

  • A. 04 const reader = new File();
    08 if (file) reader.readAsDataURL(file);
  • B. 04 const reader = new FileReader();
    08 if (file) URL.createObjectURL(file);
  • C. 04 const reader = new File();
    08 if (file) URL.createObjectURL(file);
  • D. 04 const reader = new FileReader();
    08 if (file) reader.readAsDataURL(file);

Answer: D

 

NEW QUESTION 41
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?

  • A. Car 2 completed the race.
  • B. Car 3 completes the race
  • C. Race is cancelled.
  • D. Car 1 crashed in the race.

Answer: A

 

NEW QUESTION 42
A developer receives a comment from the Tech Lead that the code given below has error:
const monthName = 'July';
const year = 2019;
if(year === 2019) {
monthName = 'June';
}
Which line edit should be made to make this code run?

  • A. 01 let monthName ='July';
  • B. 03 if (year == 2019) {
  • C. 02 const year = 2020;
  • D. 02 let year =2019;

Answer: A

 

NEW QUESTION 43
Refer to the code below:
let timeFunction =() => {
console.log('Timer called.");
};
let timerId = setTimeout (timedFunction, 1000);
Which statement allows a developer to cancel the scheduled timed function?

  • A. clearTimeout(timerId);
  • B. removeTimeout(timerId);
  • C. removeTimeout(timedFunction);
  • D. clearTimeout(timedFunction);

Answer: A

 

NEW QUESTION 44
Refer to the code below:
Const myFunction = arr => {
Return arr.reduce((result, current) =>{
Return result = current;
}, 10};
}
What is the output of this function when called with an empty array ?

  • A. Returns 0
  • B. Returns NaN
  • C. Returns 10
  • D. Throws an error

Answer: C

 

NEW QUESTION 45
Refer to the code below:
Let inArray =[ [ 1, 2 ] , [ 3, 4, 5 ] ];
Which two statements result in the array [1, 2, 3, 4, 5] ?
Choose 2 answers

  • A. [ ]. concat ( [ ....inArray ] );
  • B. [ ]. Concat (... inArray);
  • C. [ ]. Concat.apply ([ ], inArray);
  • D. [ ]. concat.apply(inArray, [ ]);

Answer: B,C

 

NEW QUESTION 46
......

CRT-600 Deluxe Study Guide with Online Test Engine: https://examsboost.actualpdf.com/CRT-600-real-questions.html